We have a Large-scale Application and it have dozens of resx file to localize application
these files build each time and take much time to build and the build process goes longer
how to remove these kind of files from build process
Maybe I'm missing somethings. If you are after to exempt ASP.NET from generating code for .resx
files, you have to remove its build provider as follows.
<compilation>
<buildProviders>
<remove extension=".resx"/>
</buildProviders>
</compilation>
I believe the default ASP.NET Resource Provider picks up local page resources using a one-to-one relationship between the pages themselves and associated *.resx files in your App_LocalResources folder. I'm not sure there is a way to change this default behaviour.
It is possible however; to implement your own Resource Provider and Resource Provider Factory. This is done by implementing the IResourceProvider interface to define your own methods for resource retrival and also creating an associated ResourceProviderFactory to instantiate instances of your custom provider.
Once you've done this you can reference the custom provider factory by adding the following to your Web.config file:
<system.web>
<globalization resourceProviderFactoryType="Company.Product.CustomResourceProviderFactory" />
</system.web>
Using this you could - for example - switch to storing your localisations in a database (as described in the guide here) instead of compiling them with your application each time, thus hopefully improving the build speed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With