Visual Studio 2026 XmlDocument not found
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với User.csx và các tham chiếu #r được nêu trong báo cáo, đồng thời so sánh cách CodegenCS.SourceGenerator phân giải System.Xml trên VS 2022 và VS 2026. Xác nhận xem tham chiếu assembly được báo cáo có cần điều chỉnh hay không; hoàn tất nghĩa là template build được với XmlDocument trên phiên bản Visual Studio mới hơn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am using the NuGet Package CodegenCS.SourceGenerator 3.5.2, this is working well with VS 2022 and XmlDocument in the .csx files:
#r "System.Xml.dll"
#r "System.Xml.ReaderWriter.dll"
// Requires CodegenCS.SourceGenerator NuGet package
using CodegenCS.Runtime;
using Newtonsoft.Json;
using System.IO;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Xml;
using System.Reflection;
public class UserTemplate
{
...
async Task<bool> GenerateConfig(ICodegenTextWriter writer, ICodegenTextWriter logWriter)
{
string prefix = string.Empty;
string key = string.Empty;
try
{
string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".apk", "ionos_dns.xml");
if (File.Exists(fileName))
{
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
XmlNode nodeDns = doc.SelectSingleNode("/dns_info/api");
if (nodeDns != null)
{
XmlAttribute attribPrefix = nodeDns.Attributes["prefix"];
if (attribPrefix != null)
{
prefix = attribPrefix.Value;
logWriter.WriteLine($"Api: Prefix={prefix}");
}
XmlAttribute attribKey = nodeDns.Attributes["key"];
if (attribKey != null)
{
key = attribKey.Value;
logWriter.WriteLine($"Api: Key={key}");
}
}
}
else
{
logWriter.WriteLine($"Configuration file not found: {fileName}");
}
}
catch (Exception ex)
{
logWriter.WriteLine($"Exception: {ex.Message}");
return false;
}
...
}
When using it with VS2026 I get the error message:
1>CSC : error CODEGENCS002: Failed to build CodegenCS Template 'User.csx' (line 64 column 17): 'Der Typname "XmlDocument" konnte nicht im Namespace "System.Xml" gefunden werden. Dieser Typ wurde an Assembly "System.Xml.ReaderWriter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" weitergeleitet. Sie sollten einen Verweis auf die Assembly hinzufügen.'
Is this simply not compatible with VS2026 or is a different #r command required?
- Ngôn ngữ chính
- C#
- Star
- 307
- Fork
- 40
- 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
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Drizin/CodegenCS
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
bug help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Postgres support Đang mởgood first issue help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Tất cả issue của Drizin/CodegenCS
Issue tương tự
-
untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
type/automation type/tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
LuckyPennySoftware/AutoMapper#4660 ·