Localization is not working after publishing ASP.NET Core App

Abdul Najeeb Anwari 21 Reputation points
2022-11-08T04:23:00.127+00:00

Hello guys,
I am using asp.net core and I am using Portable Object Localization.
My localization is working fine but after publishing my app, the localization is not working. I want to publish my web app to a folder. I defined (ps, en, prs-Af) localizations but I get the below folders.
258019-screenshot-2022-11-08-084738.png

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 questions
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,051 Reputation points Microsoft Vendor
    2022-11-10T05:26:27.737+00:00

    Hi @Abdul Najeeb Anwari ,

    I mean after publishing to the folder no localization is working at all.

    Okay, I got it. Perhaps the issue relates the localization resource files, might be they are not published. You can check the localization resource file's property, make sure build action is "Embedded resource". Like this:

    259001-image.png

    After clicking the publish option, you can find the resource file from the language folder, like this:

    258980-image.png

    259021-image.png

    Then, you can copy these files (include the resource file), and host on IIS.

    Besides, when you right click the resource file, there also has an option to publish the resource file, you can also try to use this option.

    258900-image.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Abdul Najeeb Anwari 21 Reputation points
    2022-11-27T05:48:07.437+00:00

    Thank you so much!
    Publishing the Resources Folder Manually worked for me. I right-clicked on Resources folder and from context menu chose the Publish Resources option.

    0 comments No comments