Skip to content

Conversation

@KevinRansom
Copy link
Contributor

There appears to be circumstances where Path.Combine treats elements not at the end of the list as extensions.

This issue here: #15294
contains this error:

#r "nuget:NBomber"
^^^^^^^^^^^^^^^^^^
stdin(1,1): error FS3217: C:\Users\woo.packagemanagement\nuget\Projects\1220--24e02601-e93e-4b40-a9bf-33a26d273aa0\Project.fsproj : error NU1101: 找不到包 NBomber。源 C:\Program Files\dotnet\library-packs, C:\Program Files\dotnet\sdk\8.0.100-preview.4.23260.5\FSharp\library-packs 中不存在具有此 ID 的包

The actual error is unrelated to this, however, the project was created in the wrong location:

C:\Users\woo.packagemanagement\nuget\Projects\1220--24e02601-e93e-4b40-a9bf-33a26d273aa0\Project.fsproj 

It should have been:

C:\Users\woo\.packagemanagement\nuget\Projects\1220--24e02601-e93e-4b40-a9bf-33a26d273aa0\Project.fsproj 

It seems as if there are circumstance where:

        let specialDir =
            Path.Combine(Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile), ".packagemanagement", "nuget")

combines the .packagemanagement as a file extension. I haven't been able to reproduce this locally. Perhaps it is locale related. This pr constructs the path more specifically

@KevinRansom KevinRansom requested a review from a team as a code owner June 5, 2023 23:21
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably would be nice to write/generate some unit tests for such things.

@KevinRansom
Copy link
Contributor Author

Probably would be nice to write/generate some unit tests for such things.

@psfinaki --- the reported issue, isn't an issue we have any control over. the NuGet.config file is not one we ever open, read , edit or anything else. It is a user file containing configuration specified by various applications. Indeed, it not having access to nuget.org is a normal, nuget scenario, and one in which we work fine. The error message even says what's wrong. It is certain that the corruption is not because of anything we do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants