-
Notifications
You must be signed in to change notification settings - Fork 793
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
Allow environment variables in #r interactive directive #1177
Comments
@xperiandri I believe what is needed is to make fsi expose some hooks for The same way |
Oooo I like this ... although it will be really painful to diagnose errors due to missing environment variable values. |
Please be very careful here. As discussed in many places I think this is
|
It never even occurred to me this would be used to locate nuget packages. Although I can see how it might be used for that. |
The thing is: I'm not completely arguing against adding environment
|
At the high level
So, I'd love to be able to do all of that. We just need to get there... |
@dsyme I've seen https://github.com/fsprojects/IfSharp/blob/master/src/IfSharp.Kernel/NuGetManager.fs#L212 Could we somehow make a single extensible way of parsing It doesn't feel right to bake this Nuget v3 support right into C# interactive as far as I know doesn't do anything with nuget packages. |
Bonus points if people responsible for C# interactive would collaborate on single API for handlers implementation. |
The main problem is that this must be available to the Langauge Service (FCS/VisualStudio/...) tooling as well or else you won't get intellisense etc. So the references need to be in-script, such as
This makes these components much like type provider components (run at design-time). |
It is not a problem then : |
the |
I heard rumors that the packages folder might come back.
|
@forki, the idea of handlers with the protocol scheme that @dsyme mentioned would be great (and maybe a default one for nuget shipped with the whole ecosystem), although it is always a problem to get the right handlers in place where we can reference them. I've heard other rumours about dotnet cli which might using paket as the defacto nuget client in the future 😄 joking of course... |
I assume the final dotnetcli product will still have something like the current project.lock.json file. So if that's the case then we would need to read that. But we have to wait a bit longer. Currently everything is rumors. Or maybe even less than rumors. |
Related- dotnet/roslyn#5654 |
Has there been any movement on this issue? I have a team that would like to have a common set of fsx scripts referencing a common set of packages that will be on each of our machines at the location of %userprofile%\.nuget\ |
No movement @cartermp What do you think of this feature? |
Another option that would be nice is to provide a way to directly access nuget packages via a configurable package manager. Config could be in the fsi.exe.config, and would provide nuget repository configuration. Then a new directive (#p for package) could be used that would allow you to specify a nuget package id and optional version to pull that package directly from the configured nuget repository. Perhaps: #p "My.Nuget.Package" "1.0.1" |
@aaronpalmer funny you should mention that: #5850 |
I expect package references will take care of the need here |
@cartermp I agree, and actually prefer the package reference option to the environment variable option. For my purposes, it would need to be able to resolve nuget package references whether run from an fsx in Visual Studio or in VS Code. So ideally the package management configuration would be available from fsi itself. |
Thanks for this suggestion, #r "nuget: " is in development (preview). We are not likely to want to add parameterized dll references, as it makes it harder to reason what is happening from just the source code. Thanks Kevin |
With introduction of dnx all the packages are located at path
%UserProfile%\.dnx\Packages
How to reference assemblies there?
This workaround does not work for me.
Repro steps
I tried
Expected behavior
It is possible to reference an assembly from a path with environment variable
Actual behavior
The is no way to load assemblies from path other than relative except this enormous approach
https://github.com/nrolland/FStat/blob/master/FStat/scriptSetup.fsx
Related information
The text was updated successfully, but these errors were encountered: