Which package used to localize in .net app
I just started a new app for a project for my course but i just run into a weird thing. I was trying to include Localization in my app and when I look for which package to use in the Microsoft documentation, they still used Microsoft.AspNetCore.Localization who has been deprecated to include new culture (look to the screen below).
I have installed Microsoft.Extensions.Localization but the method on the screen isn't include in this package
I cant figure out if I'm missing something or there is an other way to include localization in my app
7 Replies
deprecated?
those are for old asp.net core 2.2, the current ones should be automatially available via framework reference
you can follow the guide at https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization how to set it up
Globalization and localization in ASP.NET Core
Learn how ASP.NET Core provides services and middleware for localizing content into different languages and cultures.
yeah, the case I run into is that I have different project who's all include my "shared" project. I was trying to include in this "shared" project, the localization to not have to set it in every other project. But my "shared project" is just a "class library" and not a ".net project". That's maybe why he doesn't found the method but found it if i write it in my other project.
for class libraries, you need to add
<FrameworkReference Include="Microsoft.AspNetCore.App" />
the web projects are created with <Project Sdk="Microsoft.NET.Sdk.Web">
which does it for youok ty, that was exactly what I was loooking for. I can now reach the method