How to set NeutralResourcesLanguageAttribute in my .NET Core project?

77 views Asked by At

I have a .NET Core desktop application project.

The compiler throws the following error:

Error MC1000 Unknown build error, 'Could not find type 'System.Resources.NeutralResourcesLanguageAttribute' in assembly 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.0\ref\netcoreapp3.1\System.Runtime.dll'.' MyProj C:\Program Files\dotnet\sdk\6.0.203\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 223

Then I added the following code in AssemblyInfo.cs:

using System.Resources;
[assembly: NeutralResourcesLanguage("en")]

The compiler still throws the same error.

Then I tried to add the following in my .csproj file

<PropertyGroup>
    <NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

The compiler still throws the same error.

I'd appreciate it if someone can give me a hint.

Thanks.

0

There are 0 answers