How to remove App_LocalResources from the build process

We have a large-scale application and it contains dozens of resx files for localizing applications

these files are collected every time and take a long time to build, and the build process takes longer

how to remove these files from the build process

+6
performance c # build resources localization
source share
2 answers

Maybe I'm missing something. If you want to free ASP.NET from generating code for .resx files, you need to remove its assembly provider as follows.

 <compilation> <buildProviders> <remove extension=".resx"/> </buildProviders> </compilation> 
+4
source share

I believe that the ASP.NET resource provider collects local page resources by default using a one-to-one relationship between the pages themselves and the associated * .resx files in the App_LocalResources folder. I'm not sure there is a way to change this default behavior.

Perhaps, however; to implement your own resource provider and Factory resource provider. This is done by implementing the IResourceProvider interface to define your own methods for restoring resources, as well as creating an associated ResourceProviderFactory to instantiate your custom provider.

Once you do this, you can reference the custom factory provider by adding the following to your Web.config file:

 <system.web> <globalization resourceProviderFactoryType="Company.Product.CustomResourceProviderFactory" /> </system.web> 

Using this, you can, for example, switch to saving the localization in the database (as described in the manual here ) instead of compiling them with your application every time, so I hope we improve the build speed.

+2
source share

All Articles