WebBrowser interop API how-to example code does not work in .NET 5.0

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

Maintainer thường phản hồi trong vòng 4 ngày

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
38/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
desktop, documentation

Hướng nghiên cứu

Cập nhật dotnet-desktop-guide/framework/winforms/controls/implement-two-way-com-between-dhtml-and-client.md. Trước tiên, hãy đọc issue dotnet/winforms#4443 được liên kết và so sánh hướng dẫn .NET 5.0 của issue đó với ví dụ .NET Framework 4.8 hiện có. Công việc được hoàn thành khi trang cảnh báo về tính không tương thích hoặc cung cấp một phiên bản .NET 5.0 được cập nhật phù hợp.

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

Mô tả

doc-bug dotnet-framework/svc okr-health okr-quality Pri2 winforms/subsvc

This how-to contains example code that worked in .NET Core 3.1 but no longer works in .NET 5.0.

See dotnet/winforms#4443 for details.

I recognize this how-to page is only for .NET Framework 4.8, but there is no other version of this how-to, and WebBrowser is a supported API of both .NET Core 3.1 and .NET 5.0.

Please consider either (a) adding a "note" element in this how-to with a warning and explanation of the issue for .NET 5.0 or (b) create and appropriately update a copy of this how-to for .NET 5.0.

If it's useful to summarize here, the correct code for .NET 5.0 should either:

  • (a) define an interface containing the signature of Test, add that interface to Form1's declaration, then annotate Form1 with ComDefaultInterface; or

  • (b) extract Test to a new type, then assign an instance of that type to ObjectForScripting (instead of assigning this).


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Ngôn ngữ chính
C#
Star
241
Fork
192
Merge trung bình
10 giờ 23 phút
Pull request đã merge (30 ngày)
6

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

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 dotnet/docs-desktop

Tất cả issue của dotnet/docs-desktop

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.