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
220 stars 10 forks source link

Adding .genereated.sln causes regressions #1332

Open sayedihashimi opened 1 month ago

sayedihashimi commented 1 month ago

Describe the Issue

In the latest preview of C# Dev Kit when you open a folder that contains a csproj but no sln it will create a sln file named {foldername}.generated.sln and previously it would create {foldername}.sln.

Let's say there is a folder named MyApp, the folder would typically contain MyApp.csproj and in the past when using C# Dev Kit it would create MyApp.sln. In this cases since the names of the sln and csproj match when you run dotnet commands like dotnet build, dotnet clean, etc they would automatically pickup the sln file and use that.

By adding .generated to the sln name the csproj and sln file no longer match on file name, so when users run commands like dotnet build they will get a prompt asking them to select the sln or project file to build.

This change should be reverted, and we should go back to the previous behavior.

cc @richlander @rainersigwald

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

No response

rainersigwald commented 1 month ago

By adding .generated to the sln name the csproj and sln file no longer match on file name, so when users run commands like dotnet build they will get a prompt asking them to select the sln or project file to build.

@baronfel found the MSBuild-side code that does this: https://github.com/dotnet/msbuild/blob/b381fcd79588b14ab2b6ab09cb57035d0336852f/src/MSBuild/XMake.cs#L3554-L3563

We could certainly expand the pattern there but I would not expect that to be approved for servicing for older .NET SDKs, so it'd be .NET 9+.

Joey-JJ commented 1 month ago

This seems to lead to issues when trying to debug newly created Azure Function apps through the VS code extension.