1
votes

With previous MVC/ASP.NET when deployed code the resx files were deployed non-compiled and was able to modify the key,values and changes were reflected. With ASP.NET Core 2+ I noticed resx get compiled into dll.

I edited .csproj with

<PropertyGroup>
  <TargetFramework>netcoreapp2.1</TargetFramework>
  <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
</PropertyGroup>

<ItemGroup>
  <Content Include="Resources\*" CopyToPublishDirectory="Always" />
</ItemGroup>

After editing the .csproj and redeploy, the Resource folder and resx files are there, but when I edit on the server in notepad the edits are not reflecting. Seems like it is still required to be compiled.

Any way to set so that the resx files can be updated without compiling? or is there a different approach in asp.net core 2?

2

2 Answers

0
votes

In Solution Explorer select the item you want published.

Look in the Properties section at the bottom of Solution Explorer

  • Change the Build Action to Content
  • Change the Copy to Output Directory to Copy Always

resx properties

You can also check out https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-2.1

0
votes

Personally I create a new class library project for resources only then I add it as a reference to the main project.

This way I can edit, compile and upload the resources library project without the need to build and upload the whole project.

Btw, resource .resx file type is not listed in class library projects new file dialog, but you can create a text file and change its extension manually to .resx an it will work fine.