Soh*_*san 0 .net c# asp.net .net-core
我想写入我的 .resx 文件。我使用了 ResXResourceWriter,它在 Windows 形式下运行良好,但在 .Net Core 应用程序中不可用。它需要 system.Windows.Forms 但 .net core 不引用它。
ResXResourceWriter resx = new ResXResourceWriter(hostingEnvironment.WebRootPath + "\Localization\LabelResource.EN.resx")
如果您已经安装了 .net Core 3.0(或更高版本)并且想要添加对现有项目 (.csproj) 的引用。
您只能添加以下标签:
<UseWindowsForms>true</UseWindowsForms> 进入以下部分: <PropertyGroup>
我认为它是新的:Visual Studio 项目上下文菜单中的菜单“编辑项目文件”。
像这样(添加到 WPF 项目中):
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\GeneralCore\GeneralCore.csproj" /> </ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6348 次 |
| 最近记录: |