dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.92k stars 785 forks source link

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

Closed JDiLenarda closed 1 year ago

JDiLenarda commented 2 years ago

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 :

So there are probably 2 bugs :

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

KevinRansom commented 2 years ago

@JDiLenarda ,

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

Thanks,

Kevin

JDiLenarda commented 2 years ago

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.

vzarytovskii commented 2 years ago

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.

JDiLenarda commented 2 years ago

@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)

vzarytovskii commented 2 years ago

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

KevinRansom commented 1 year ago

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 commented 1 year ago

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

Thanks

Kevin

beyonce

KevinRansom commented 1 year ago

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

JDiLenarda commented 1 year ago

@KevinRansom

It's an improvement on the following points :

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.