'Razor Pages Cannot Read File with build action "Content" Properties

I have a resources file name "Index.en-US.resx", initially it was "embedded resources" build action and it worked well in localization.

But when it is "embedded resources", it compiled it into .dll file. In my case, users are able to modify the content of .resx file from time to time. It cannot be .dll file after published.

Is there anyway to read the .resx file as "content" (since it will not be compiled into .dll) ?



Solution 1:[1]

If you don't want your .resx file to be compiled into dll after published, I think you can put it in your wwwroot, Because wwwroot is where static files are stored, the project will not compile it as a dll, As follow. You can see the resource file is not be compiled in dll after published.

enter image description here

enter image description here

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Xinran Shen