Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated solutions are unstable with multiple project inputs #611

Open
jdrobison opened this issue Oct 4, 2024 · 3 comments
Open

Generated solutions are unstable with multiple project inputs #611

jdrobison opened this issue Oct 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jdrobison
Copy link
Member

I'm finding that the solutions generated by slngen are not stable, at least when multiple projects are supplied on the command line. I discovered this while writing an MSBuild target to diff two solutions.

Here's the command line I'm using, by way of the SlnGen MSBuild target (as updated by #609) I've placed one parameter per line to make it more legible.:

slngen.exe 
--nologo 
--verbosity:Minimal 
--consolelogger:NoSummary;ForceNoAlign 
--folders:true 
--launch:false 
--solutionfile:Microsoft.VisualStudio.Shell.sln 
--configuration:"Debug;Release" 
--platform:AnyCPU 
--property:"NuGetInteractive=true;IsGraphBuild=true" 
Microsoft.VisualStudio.Shell.csproj 
..\..\..\UnitTests\FileChangeManager\FileChangeManagerTests.csproj 
..\..\..\UnitTests\FileColorServiceTests\FileColorServiceTests.csproj 
..\..\..\UnitTests\FileSystemTests\FileSystemTests.csproj 

My expectation is that the first project on the command line will be the first one in the solution, and therefore the default startup project. That's what I get most of the time, but that doesn't seem to be consistent.

I've attached two generated solutions (with a .txt extension added, since .sln files can't be attached):

  • Microsoft.VisualStudio.Shell.sln.txt: the expected output, with Microsoft.VisualStudio.Shell.csproj as the first project
  • Microsoft.VisualStudio.Shell.unexpected.sln.txt: this one has FileChangeManagerTests.csproj as the first project, and differing solution folders as a result

Microsoft.VisualStudio.Shell.sln.txt
Microsoft.VisualStudio.Shell.unexpected.sln.txt

@mruxmohan4
Copy link
Contributor

Closing this issue as it has been resolved with #609, which was deployed in the 11.4.6 release.

@jdrobison
Copy link
Member Author

@mruxmohan4, #609 doesn't resolve this issue, I just happened to discover it while working on #609. Did you mean to refer to another PR which resolved this issue?

@mruxmohan4 mruxmohan4 reopened this Oct 8, 2024
@mruxmohan4 mruxmohan4 added the bug Something isn't working label Oct 8, 2024
@kasperk81
Copy link

kasperk81 commented Oct 11, 2024

switch to https://github.com/microsoft/vs-solutionpersistence from vs team, will fix a lot of issues and enable slnx support. msbuild is making a switch dotnet/msbuild#10794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants