开发者

How to remove App_LocalResources from Build Process

We have a Large-scale Application and it have dozens of resx file to local开发者_开发问答ize 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜