c# - 错误 MSB3823 : Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true

标签 c# .net batch-file .net-core .net-5

大家好,我遇到了一个错误,我正在尝试解决它我找到了一些类似的来源,但无法解决我的问题。类似的问题,如 here .
我编译我的项目 .csproj文件使用 .bat文件实际上是 .batch文件来自 cmd .但我收到了这个错误: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 中添加这些 xml 节点文件:
<PropertyGroup> 
    <GenerateResourceMSBuildArchitecture>
        CurrentArchitecture
    </GenerateResourceMSBuildArchitecture>
    <GenerateResourceMSBuildRuntime>
        CurrentRuntime
    </GenerateResourceMSBuildRuntime>
</PropertyGroup>
然后我再次使用 cmd 中的 bat 文件进行编译,但仍然出现构建错误。如何克服这个提前感谢。请注意,在我的机器中,我使用的是 .NET 框架版本 4.8 和 .Net core 5

最佳答案

请加系统.资源.扩展 NuGet 打包成合适的项目。

关于c# - 错误 MSB3823 : Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66356322/

相关文章:

c# - 使用 WinSCP 对远程 SFTP 文件夹中的文件进行计数

c# - 如何按行对二维数组进行排序?

c# - 当尝试写入文件抛出 UnauthorizedAccessException 时,需求不会抛出异常

c# - BinaryFormatter 是否应用任何压缩?

windows - 在 cmd 批处理文件中使用非 ASCII 字符

javascript - 如何运行多个js服务器

c# - 什么时候应该在C#中使用using(…){…}?

c# - 对 WCF Web API 进行版本控制的最佳方式是什么?

Windows 批处理脚本 : Unable to copy files containing html tags to another file

c# - Silverlight - 从部分中删除隐式样式