我想写我的.resx文件。我使用过ResXResourceWriter,它在Windows窗体中运行良好但在.Net Core应用程序中不可用。它需要system.Windows.Forms但.net核心不引用它。
ResXResourceWriter resx = new ResXResourceWriter(hostingEnvironment.WebRootPath +“\ Localization \ LabelResource.EN.resx”)
您目前需要使用.Net Core 3.0 Preview,因为System.Windows.Forms是.Net Core 3.0中的新功能。来自System.Windows.Forms repository:
您可以使用以下命令使用dotnet new命令创建新的WinForms应用程序:
dotnet new winforms -o MyWinFormsApp cd MyWinFormsApp dotnet run