0

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) ?

Jun Yan
  • 11
  • 1
  • 4
  • Do you want to modify the resouces file after project compiled? If your question is this, you can refer to this [issue](https://stackoverflow.com/questions/782899/editing-resource-files-without-recompiling-asp-net-application). – Xinran Shen Apr 26 '22 at 01:53
  • Setting build action to content didn't work for me, maybe Razor only can read embedded resources? – Jun Yan Apr 26 '22 at 07:53
  • Do you want to read this resource file like a static file after published? – Xinran Shen Apr 27 '22 at 09:38
  • Yes, but not as `dll` – Jun Yan Apr 28 '22 at 02:20

1 Answers1

0

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

Xinran Shen
  • 8,416
  • 2
  • 3
  • 12