.slnx solution files still cause "No file format header found" in v10.0.1

Đang mở Phù hợp với người mới
#1,271 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với CodeConv/CodeConv.csproj và CodeConverter/CodeConverter.csproj, sau đó kiểm tra bốn tham chiếu gói Microsoft.CodeAnalysis hiện đang ở phiên bản 4.14.0. Xác minh việc cập nhật dependency dựa trên lỗi .slnx được mô tả trong issue và kiểm thử chuyển đổi một dự án VB bằng một solution .slnx. Hoàn tất khi solution mở được mà không gặp file-format-header exception.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.MSBuild 4.14.0 → 5.3.0
  • Microsoft.CodeAnalysis.CSharp.Workspaces 4.14.0 → 5.3.0
  • Microsoft.CodeAnalysis.VisualBasic.Workspaces 4.14.0 → 5.3.0
  • Microsoft.CodeAnalysis.CSharp.Features 4.14.0 → 5.3.0
References
Ngôn ngữ chính
C#
Star
913
Fork
244
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của icsharpcode/CodeConverter

Tất cả issue của icsharpcode/CodeConverter

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.