我有一个 .NET Core 桌面应用程序项目。
编译器抛出以下错误:
错误 MC1000 未知构建错误,“在程序集 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref .1.0 中找不到类型 'System.Resources.NeutralResourcesLanguageAttribute'” 埃夫 etcoreapp3.1\System.Runtime.dll'.' MyProj C:\Program Files\dotnet\sdk .0.203\Sdks\Microsoft.NET.Sdk.WindowsDesktop argets\Microsoft.WinFX.targets 223
然后我在
AssemblyInfo.cs
中添加了以下代码:
using System.Resources;
[assembly: NeutralResourcesLanguage("en")]
编译器仍然抛出相同的错误。
然后我尝试在我的
.csproj
文件中添加以下内容
<PropertyGroup>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
编译器仍然抛出相同的错误。
如果有人能给我提示,我将不胜感激。
谢谢。
对于所有
assembly
属性,您必须使用 AssemblyAttribute
节点:
<ItemGroup>
<AssemblyAttribute Include="System.Resources.NeutralResourcesLanguageAttribute">
<_Parameter1>en</_Parameter1>
</AssemblyAttribute>
</ItemGroup>