Visual Studio 2012 Express, MVC 4 App: Selecting 'Debug' or 'Release' in solution configuration drop down doesn't work.
I have Web.Release.Config & Web.Debug.Config. There is a transform
<appSettings>
<add key="Environment" value="Release" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
that changes this in web.config:
<add key="Environment" value="DEVELOPMENT" />
to this in release mode (web.release.config)
<add key="Environment" value="Release" />
I have previewed it by right clicking on Web.Release.Config and 'preview transform' - and it behaves as it should.
On a view I have the following: @System.Configuration.ConfigurationManager.AppSettings["Environment"]
It always shows 'DEVELOPMENT' - it is never blank - regardless whether I select 'Debug' or 'Release' from the solution configuration drop down prior to clicking 'start without debugging'

Shouldn't this work? Thanks.