Frage

Let's say that in my main startup project I have web.config file with some setting:

<!-- ... -->
<appSettings>
    <add key="Setting" value="setMe!" />
</appSettings>
<!-- ... -->

This project has two configurations: Release and Debug. Each transforms this setting to its own value, for example web.Debug.config:

<!-- ... -->
<appSettings xdt:Transform="Replace">
    <add key="Setting" value="debugValue" />
</appSettings>
<!-- ... -->

When I compile it there is no transformed config file. I have only three files: web.config, web.Debug.config and web.Release.config.

War es hilfreich?

Lösung

You have to publish your project ("Publish Web Site" command) and your destination (IIS) will use the correct web.config file with your Release configuration.

Andere Tipps

Configuration transformation is only done when publishing. Your base configuration file should have your development settings. If you choose to use the default build configurations, normally the release transform file should contain your production environment settings and the debug transform file will contain your test environment settings.

Personally, I usually create a new build configuration for testing and for production and leave the debug and release transforms empty.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top