大家好,我遇到了一个错误,我正在试图解决它,我找到了一些类似的来源,但无法解决我的问题。类似的问题,如这里。
我使用.csproj
文件编译了我的项目.bat
文件,实际上它是来自cmd
的.batch
文件。但我发现了一个错误:
error MSB3823: Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true. [C:\Users\rmrud\source\Workspaces\Workspace2\HAL9\v3_07\Test\Test\Test.csproj]
我还得到了这个
error MSB3822: Non-string resources require the
System.Resources.Extensions assembly at runtime, but it was not found in this project's references. [C:\Users\rmrud\source\Workspaces\Workspace2\HAL9\
v3_07\Test\Test\Test.csproj]
我还在cmd choco install visualstudio2019-workload-netcoretools
中运行了此操作。
我编辑了我的.csproj
文件,在xxx.csproj
文件中添加了以下xxx.csproj
节点:
<PropertyGroup>
<GenerateResourceMSBuildArchitecture>
CurrentArchitecture
</GenerateResourceMSBuildArchitecture>
<GenerateResourceMSBuildRuntime>
CurrentRuntime
</GenerateResourceMSBuildRuntime>
</PropertyGroup>
再一次,我使用cmd中的bat文件进行编译,但仍然得到了生成错误。如何提前克服这一感谢。请注意,在我的机器中,我使用的是.NET框架版本4.8和.Net核心5
发布于 2021-05-02 16:06:57
请将System.Resources.Extensions NuGet包添加到适当的项目中。
https://stackoverflow.com/questions/66356322
复制相似问题