Multiple Resource Files in .NET

1

Is it possible to have 2 resource files in visual studio with the same resources name, one of which is intended for testing environments and another for production environments?

    
asked by anonymous 06.10.2014 / 16:57

1 answer

1

Exactly with the same name, but you can have a file with the same prefix, adopting a suffix like differentiation, such as:

  • MinhaResource.Debug.resx
  • MinhaResource.Release.resx

In your application configuration file ( App.config or Web.config , depending on the nature of the application), you can define the parameterization of which environment is being used:

<configuration>
  ...
  <appSettings>
    <add key="Ambiente" value="Release" />
  </appSettings>
  ...
</configuration>

To load the Resource using this setting, you may need to create your own ResourceProvider . As the explanation is very extensive, it is not worth including in the answer.

    
06.10.2014 / 20:24