microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
209 stars 7 forks source link

[BUG] `RestoreConfigFile` path is incorectly resolved when using .sln #1205

Open irvnriir opened 1 month ago

irvnriir commented 1 month ago

Describe the Issue

We have project structure like the following:

folder1\
    folder2\
        .csproj
    folder3\
        nuget.config
.sln

When RestoreConfigFile has a relative path, at Restoring (auto), that path is considered to be from folder which is opened as Workspace folder.

When using Build on the Solution or Project in the Solution Explorer, it errors with the following: image

Steps To Reproduce

No response

Expected Behavior

Ability to set build working directory per .sln, so RestoreConfigFile would use that and not require that the folder would be Added To Workspace. And Build trough this Extension not crashing if RestoreConfigFile is present.

Environment Information

No response

irvnriir commented 1 month ago

nuget.config also can't be replaced with MSBuild Properties, because there are no documented ones for specifying which packages to trust. dotnet nuget trust also adds items to: %userprofile%\Roaming\NuGet, not project files.

irvnriir commented 1 month ago

edited the Issue