dynamic type fails sourcegenerator CS8785 'MessagePackGenerator' failed to generate source.

Đang mở
#2,318 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

@1AbdullahButt đang làm issue này rồi.

Từ ngày 8/11/2026.

  • #2319 của @1AbdullahButt — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start with the MessagePack source generator and analyzer named in the errors, then trace how they handle the reproduced dynamic field in AnObject. The issue provides no file or test path, so first locate the generator tests for unsupported member types. Done means this case no longer throws during generation and compilation has no generator errors; pull request #2319 is already open.

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

Mô tả

Bug description

dynamictype in PackObject fails sourcegenerator

Repro steps
[MessagePackObject(keyAsPropertyName: true)]
public class AnObject
{
        public dynamic value;
}
Expected behavior

No messages

Actual behavior
    CSC : error CS8785: Generator 'MessagePackGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'NotSupportedException' with message 'Specified method is not supported.'.
    CSC : error AD0001: Analyzer 'MessagePack.SourceGenerator.Analyzers.MsgPack00xMessagePackAnalyzer' threw an exception of type 'System.NotSupportedException' with message 'Specified method is not supported.'.

(Using WarningsAsErrors)

  • Version used: 3.1.12
  • Runtime: (e.g. .NET Framework, .NET Core, Unity, mono, etc.): netstandard2.0
Additional context

Similar issues, but different types, so worth a separate issue to track this one.
When this happens it would be nice to have the error include which method is not supported, and maybe also have an attribute that IgnoreSourceGenerationIfUnknownAndIfAlreadyReportedUpstream

Ngôn ngữ chính
C#
Star
6.8k
Fork
783
Merge trung bình
19 giờ 47 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 MessagePack-CSharp/MessagePack-CSharp

Tất cả issue của MessagePack-CSharp/MessagePack-CSharp

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.