.slnx solution files still cause "No file format header found" in v10.0.1
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- build-system, tooling
Research direction
Start with CodeConv/CodeConv.csproj and CodeConverter/CodeConverter.csproj, then inspect the four Microsoft.CodeAnalysis package references currently at 4.14.0. Verify the dependency update against the .slnx failure described in the issue and test conversion of a VB project using a .slnx solution. Done means the solution opens without the file-format-header exception.
Written by the indexing model from the issue text.
Description
CodeConverter Version: 10.0.1
OS: Windows
Error
Microsoft.Build.Exceptions.InvalidProjectFileException: No file format header found.
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.LoadSolutionInfoAsync(...)
at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenSolutionAsync(...)
at ICSharpCode.CodeConverter.CommandLine.MsBuildWorkspaceConverter.SolutionLoader.AnalyzeSolutionAsync(...) in MsBuildWorkspaceConverter.cs:line 87
Description
Despite issue #1195 being listed as fixed in v10.0.1, converting a VB project using a .slnx
solution file still fails with the above error. The bundled
Microsoft.CodeAnalysis.Workspaces.MSBuild.dll is version 4.14.0 (file version
4.1400.25.26210). MSBuildWorkspace in 4.x tries to parse .slnx as a traditional .sln file
and fails at the file header check — .slnx is XML-based and has no such header.
Root Cause
.slnx support in MSBuildWorkspace.OpenSolutionAsync requires
Microsoft.CodeAnalysis.Workspaces.MSBuild 5.x. The latest stable is 5.3.0.
Proposed Fix
Update CodeConv/CodeConv.csproj (and CodeConverter/CodeConverter.csproj):
Microsoft.CodeAnalysis.Workspaces.MSBuild4.14.0 → 5.3.0Microsoft.CodeAnalysis.CSharp.Workspaces4.14.0 → 5.3.0Microsoft.CodeAnalysis.VisualBasic.Workspaces4.14.0 → 5.3.0Microsoft.CodeAnalysis.CSharp.Features4.14.0 → 5.3.0
References
- Re-opens / follow-up to #1195
- NuGet: https://www.nuget.org/packages/Microsoft.CodeAnalysis.Workspaces.MSBuild/5.3.0
- Dominant language
- C#
- Stars
- 913
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from icsharpcode/CodeConverter
-
C# -> VB
Difficulty 4/5 3-5 days Newbie friendliness 35/100
icsharpcode/CodeConverter#1281 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
icsharpcode/CodeConverter#1275 ·
-
VB -> C#
Difficulty 3/5 1-2 days Newbie friendliness 62/100
icsharpcode/CodeConverter#1273 ·
-
VB -> C#: "Group By Into" Linq queries supressing aggregations ("Into" part) in the converted code OpenDifficult area VB -> C#
Difficulty 3/5 1-2 days Newbie friendliness 74/100
icsharpcode/CodeConverter#1272 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
icsharpcode/CodeConverter#1270 ·
All issues in icsharpcode/CodeConverter
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·