-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify location of DLLs for C# Interactive #116
Comments
I've just started exploring C# Interactive and evaluating F# alongside. I would have really liked this in the C# Interactive too, to give me the equivalent of "sys.path.append()" I use in python all the time. |
There is: ReferencePaths.Add(@"c:\dlls"); The new paths are used to resolve relative SourcePaths.Add(@"c:\scripts"); The new paths are used to resolve relative |
Is this documented anywhere? |
I only see it in the unit tests for the Interactive window source code. |
@lcorrigan Indeed, You could potentially work around the lack of |
I'm curious about this setup. Can you share more details? |
@tmat We have been using IronPython with a folder of .NET libraries written in VB.NET for a number of years now. Some are 32-bit ".NET Framework" and will have to stay that way for reason's I'd rather not waste your time on. I've been evaluating replacement options for IronPython. Long story short, we have structured different directories of python code to simply reference the single bucket of libraries, and since it was interpreted, no DLL's were ever auto-copied from that location to the bin folder. Just one SVN checkout on the CPU - no mess. When using the editor (VS or Eclipse Pydev), we just needed to add the lib path to the project. For the interpreter window, there was a config file we placed the path in to find it at startup (similar to /lib: for CSharpInteractive.rsp). For auto-work, we used Jenkins jobs that would run python modules (which would do sys.path.append("the single lib folder")) and had the best of all 3 worlds, never needing to muck with packaging. There might be things we could explore to make the transition to C# Scripting easier (like create a Nuget for our libs? etc) or re-structuring how we do things, but for now I was just trying to find the smoothest transition to a language that fit our dev model the best. Where I'm at now: I can get the Interactive window to see the external lib folder (thanks to your commands and/or the CSharpInteractive.rsp file), and running on the command line accepts external paths for references, so I'm covered there too. However, the minute I removed my using absolute path #r calls in my csx files, the VS editor lost sight of the libraries. I know (or believe) the Rosyln compiler only support full paths, but I figured if I gave the project enough information (references/paths etc) it would be able to figure it out. Nope. I've not found the magic combination of project settings to make it resolve /intellisense without each .dll's absolute path. I've been struggling with this concept on-and-off since 2003 (original pythonnet + Spyder etc), so I'm used to this, but what's astonishing me the most is how little I've had to tell F# in order for it to just work for my use-case. I think that '#I' flag is providing the missing link I'd need on C#. Unfortunately for my relationship with my team, the more I'm playing with F#, the more I'm starting to like what I see for the kind of work I do - a lot actually.....might be time to go rogue. |
@lcorrigan welcome to the Dark Side :-) |
F# Interactive
#help
shows these options:C# Interactive
#help
shows these options:One of the great features of F# scripts is the
#I
directive, which tells F# Interactive where to look for referenced DLLs.Is there an equivalent way to do this in C# scripts?
The text was updated successfully, but these errors were encountered: