Skip to content

Generated solutions are unstable with multiple project inputs #611

@jdrobison

Description

@jdrobison

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions