si2030
si2030

Reputation: 4045

Dotnet Core - Getting a warning ""ark assemblies with NeutralResourcesLanguageAttribute"

I am getting the following warning:

Warning CA1824  Mark assemblies with NeutralResourcesLanguageAttribute  JobsLedger.INITIALISATION

I found this.

However I don't know still, how to add the following or indeed if this is what I need to do..

[assembly: NeutralResourcesLanguage("en")]

Could someone tell me what I need to do to remove this error..

Upvotes: 2

Views: 404

Answers (1)

Roman Marusyk
Roman Marusyk

Reputation: 24619

You can add this attribute to any file in a project. If you have Program.cs or Startup.cs then put it there

using System;
using System.Resources;

[assembly: NeutralResourcesLanguage("en")]

namespace ConsoleApp
{
    public static class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }

}

Or if you want ignore it, add

<NoWarn>CA1824</NoWarn>

to .csproj file

Upvotes: 1

Related Questions