fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Loading nuget package in FSI fails when a source path contains accentuated character

Open JDiLenarda opened this issue 3 years ago • 5 comments

In the Visual Studio (2019 or 2022) Nuget package manager, add 2 sources :

C:\nuget\rihanna C:\nuget\beyoncé

Create the underlying directories as well.

Then in Visual Studio FSI Window, type :

#r "nuget: Newtonsoft.Json";;

You will get :

stdin(1,1): error FS3217: The source directory 'C:\Nuget\beyonc%EF%BF%BD' not found

Notes :

  • the package that is tried to be load is not supposed to be found in any local package.
  • you get the error even if the faulty source is unticked in the package manager. You have to remove it.

So there are probably 2 bugs :

  • Visual Studio FSI has problem with nuget package source containing accentuated character (or at least 'é')
  • Visual Studio FSI try to connect to every package source from the package manager, even unticked ones.

Windows 10.0.18363, set to fr-FR culture Visual Studio 2019 16.11.6 F# Interactive version 11.4.2.0 pour F# 5.0

Maybe related to #11392

JDiLenarda avatar Nov 16 '21 13:11 JDiLenarda

@JDiLenarda ,

Thanks for reporting this, the restore source is not escaped, when included for resolution. We will address this.

Thanks,

Kevin

KevinRansom avatar Nov 16 '21 17:11 KevinRansom

I don't know if any progress have been made on this issue, but I just noticed it raises when using #r "nuget: whatever" from a Dotnet Interactive C# cell code. So the problem looks wider than F#, probably from the Nuget Package Manager.

Edit: ~~it happens in C# Interactive as well.~~ Where should I bring this issue ? Nuget.Client ? Dotnet Interactive ? Csharplang ?

Edit 2 : pointless remark about C# Interactive stroked, my CSI version doesn't support nuget reference.

JDiLenarda avatar Jul 08 '22 09:07 JDiLenarda

Edit: it happens in C# Interactive as well. Where should I bring this issue ? Nuget.Client ? Dotnet Interactive ? Csharplang ?

You mean in the C# cell in the .NET interactive? In this case, I think it's still the dependency manager.

vzarytovskii avatar Jul 08 '22 13:07 vzarytovskii

@vzarytovskii : in this sentence I meant it happens in CSI, but my bad, CSI doesn't support nuget reference. But as I told in the previous sentence, yes it does happens in C# (and F#) code cells in .NET Interactive.

FSI error message : stdin(1,1): error FS3217: The source directory 'C:\Beyonc%EF%BF%BD' not found

.NET interactive error message (both C# or F# cell code) : Error: PackageManagement Error 3217 Le répertoire source 'C:\Beyonc%EF%BF%BD' est introuvable (same message as FSI except localized)

JDiLenarda avatar Jul 08 '22 13:07 JDiLenarda

I see, yeah, it sounds like it is handled by dependency manager.

vzarytovskii avatar Jul 08 '22 14:07 vzarytovskii

The dependency manager is an FSI component that is used by dotnet interactive to handle package management. Whenever I talk about #r nuget , the dependency manager is what I am talking about, wherever it is surfaced.

KevinRansom avatar Nov 17 '22 22:11 KevinRansom

@JDiLenarda --- This seems to be working for me. Can you verify that you still have an issue with this:

Thanks

Kevin

beyonce

KevinRansom avatar Nov 17 '22 23:11 KevinRansom

Also the disabled sources bug was fixed a few months ago. Thanks

KevinRansom avatar Nov 17 '22 23:11 KevinRansom

@KevinRansom

It's an improvement on the following points :

  • accented characters are now supported,
  • disabled sources are not searched anymore,
  • also impacts dotnet Interactive.

But if the source is unreachable, I get an error error FS3217: The source directory '\\network\repos' not found. IMHO, that would be better as a warning, then produce an error if a package itself is unreachable. That point being outside the scope of the described issue, I'm closing it anyway.

JDiLenarda avatar Nov 20 '22 16:11 JDiLenarda