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

MSBuildWorkspace.OpenSolutionAsync fails with the new slnx files #73004

Closed
virzak opened this issue Apr 12, 2024 · 2 comments
Closed

MSBuildWorkspace.OpenSolutionAsync fails with the new slnx files #73004

virzak opened this issue Apr 12, 2024 · 2 comments
Labels
Area-IDE Resolution-External The behavior lies outside the functionality covered by this repository untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@virzak
Copy link

virzak commented Apr 12, 2024

Version Used: Microsoft.CodeAnalysis.Workspaces.MSBuild 4.9.2

Steps to Reproduce:

  1. Create a solution file
  2. Save As slnx using Visual Studio Version 17.10.0 Preview 3.0 or later image
  3. Add reference to Microsoft.CodeAnalysis.Workspaces.MSBuild
  4. Try opening the solution
var workspace = MSBuildWorkspace.Create();
var solution = await workspace.OpenSolutionAsync(@"C:\PathTo\ExampleSlnx.slnx").ConfigureAwait(false);

Expected Behavior:

Should have no exception. It doesn't occur when opening "ExampleSlnx.sln"

Actual Behavior:

Microsoft.Build.Exceptions.InvalidProjectFileException
HResult=0x80131500
Message=No file format header found. Q:\Code\Sandbox\ExampleSlnx\ExampleSlnx.slnx
Source=Microsoft.Build
StackTrace:
at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, String resourceName, Object[] args)
at Microsoft.Build.Construction.SolutionFile.ParseFileHeader()
at Microsoft.Build.Construction.SolutionFile.ParseSolution()
at Microsoft.Build.Construction.SolutionFile.ParseSolutionFile()
at Microsoft.Build.Construction.SolutionFile.Parse(String solutionFile)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.d__22.MoveNext()
at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.d__24.MoveNext()
at Program.<

$>d__0.MoveNext() in Q:\Code\Sandbox\ExampleSlnx\ExampleSlnx\Program.cs:line 9

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 12, 2024
@huoyaoyuan
Copy link
Member

The stack trace belongs to MSBuild, not roslyn.
As the new format is still in development, integration with MSBuild is simply not done yet.

@virzak
Copy link
Author

virzak commented Apr 15, 2024

@huoyaoyuan Moving to dotnet/msbuild#10012

@virzak virzak closed this as completed Apr 15, 2024
@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@sharwell sharwell added the Resolution-External The behavior lies outside the functionality covered by this repository label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Resolution-External The behavior lies outside the functionality covered by this repository untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

3 participants