Closed kevmal closed 6 months ago
Thank you for this Kevin. In my case it was affecting interactive, see: https://github.com/dotnet/interactive/issues/3289
Just to reiterate: This issue appears to be the root cause of this issue
https://github.com/dotnet/interactive/issues/3289
Likely broken in this PR: https://github.com/dotnet/fsharp/pull/14769
@KevinRansom
Seems not to like package sources with spaces in the name
Okay, I understand now.
The issue occurs when the sources are specified in a Nuget.config file alongside the script.
For example: A script that says:
#r "nuget:FSharp.Compiler.Service, 43.8.300-dev"
Alongside a Nuget.config file containing:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- Only specify feed for Arcade SDK (see https://github.com/Microsoft/msbuild/issues/2982) -->
<packageSources>
<clear />
<add key="MySourceDirectory" value="C:\\temp\\repro\\my source directory" />
</packageSources>
</configuration>
Will not find files the nuget package in: "C:\temp\repro\my source directory".
This is certainly a bug, and I will fix it. In the mean time this is equivalent and will work. Update the script to include the source using the #i directive
#i "nuget:C:\\temp\\repro\\my source directory"
#r "nuget:FSharp.Compiler.Service, 43.8.300-dev"
I was seeing it with global nuget config also, and when the "key" had a space, not the directory
If a nuget source has name with a space in it then it's skipped. Looks like the regex assumes no spaces: https://github.com/dotnet/fsharp/blob/1492e70e6d99931ce5133819ebaf4caaadf8da54/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs#L312-L342