How to edit Resources file (.resx ) after publishing in Blazor Server Project ?

AGRAHARI Shyam 0 Reputation points
2023-01-23T07:29:57.2066667+00:00

Hi, I have a Blazor Server Project in which I want to add a feature to Edit resource files after publishing. Exactly after publishing, there would be a publish folder in the bin directory of the project. I need to edit the string in the resources file contains in the bin directory.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,585 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
795 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
630 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 28,276 Reputation points
    2023-01-23T17:13:53.7133333+00:00

    this is not really practical. the easiest approach is to move the resource file to its own dll. then after publish you can regenerate it with the c# compiler api. a recycle would be required to read it.

    you are better of replacing the resource files with a database, or structured file.

    No comments