C
C#3w ago
FoxySnake

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
No description
7 Replies
Sehra
Sehra3w ago
deprecated?
FoxySnake
FoxySnakeOP3w ago
No description
Sehra
Sehra3w ago
those are for old asp.net core 2.2, the current ones should be automatially available via framework reference
Sehra
Sehra3w ago
Globalization and localization in ASP.NET Core
Learn how ASP.NET Core provides services and middleware for localizing content into different languages and cultures.
FoxySnake
FoxySnakeOP3w ago
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.
Sehra
Sehra3w ago
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 you
FoxySnake
FoxySnakeOP3w ago
ok ty, that was exactly what I was loooking for. I can now reach the method

Did you find this page helpful?