C# 无法从.Net Core 2.2类生成XSD文件

C# 无法从.Net Core 2.2类生成XSD文件,c#,.net-core,xsd,.net-core-2.2,C#,.net Core,Xsd,.net Core 2.2,我正在尝试将.NETCore(2.2)类转换为xsd文件。这门课很简单 [GeneratedCodeAttribute("xsd", "4.0.30319.1")] [SerializableAttribute()] public class Core_Class { public int ID { get; set; } } 每次我试图运行xsd.exe在.net核心类上为我的类创建xsd文件时,我都会遇到以下错误 Error: There was an error processi

我正在尝试将.NETCore(2.2)类转换为xsd文件。这门课很简单

[GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[SerializableAttribute()]
public class Core_Class
{
    public int ID { get; set; }
}
每次我试图运行xsd.exe在.net核心类上为我的类创建xsd文件时,我都会遇到以下错误

Error: There was an error processing 'C:\Users\....\repos\.....\.....\bin\Debug\netcoreapp2.2\.....dll'.
  - Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

如果在标准.net framework 4.6项目中使用xsd.exe运行相同的命令,则会正确生成xsd文件。有什么方法可以从.net核心类生成xsd文件吗?

在四处搜索并没有找到这个问题的答案后,我找到了一个解决方法,而不是解决方案。我必须将.NET核心库转换为.NET标准2.0类库。转换为.NET标准库允许.NET core和.NET framework(4.6+)引用它们。在此之后,xsd.exe按预期工作