<分区>
我有一些用 .NET Core 编写的库
我可以在 Windows 窗体应用程序中使用这些库吗?
我可以将它们引用到我的 Win Forms 或 WPF 中吗?
一般情况下,我可以在 .NET Core 旁边使用 .NET Framework 吗?
因为我想迁移到 .NET Core,但我的项目也需要 GUI,而目前 .NET Core 不支持它
@JonSkeet 问我你测试了吗? 是的,我用我的 WinForm GUI 测试了一个非常简单的 dotNETCore
在 dotNET 核心中
public class Person
{
[EmailAddress]
public string Name { get; set; }
}
public static class TestCore
{
public static string Get()
{
var type = typeof(Person).GetProperty("Name");
var attr = type.Attributes;
return attr.ToString();
}
}
我使用反射是因为其中的反射命名空间发生了变化
所以我通过单击按钮在我的 GUI 中调用 Get() 方法。但是告诉我一个错误
Additional information: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
我将该库添加到我的 winform 项目中,然后 booooooom !!! 现在我的 Winform 项目不工作了!!!
Warning RCS1060 Consider declaring each type in separate file. dotNETCore..NETStandard,Version=v1.5 \visual studio 2015\Projects\dotNETCore\src\dotNETCore\Person.cs
Error CS0433 The type 'EditorBrowsableAttribute' exists in both 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' WindowsFormsApplication1 \visual studio 2015\Projects\dotNETCore\WindowsFormsApplication1\Properties\Resources.Designer.cs
似乎出了点问题,但我希望我可以同时使用 .NET Framework 和 dotNET Core,因为我们还没有任何 GUI 解决方案!
我希望 MICROSOFT 致力于 .NET Core 版本的 WPF。