Last post Sep 17, 2016 11:08 PM by Angie xu - MSFT
Sep 15, 2016 05:35 PM|WilliamSnell|LINK
I read a couple articles on setting this up, such as this one: http://vishaljoshi.blogspot.com/2010/05/applying-xdt-magic-to-appconfig.html
But I was left with a couple questions. First, the article said to add the following to the .csproj file: <ProjectConfigFileName>App.Config</ProjectConfigFileName>
I get the squiggly line and an error saying this isn't a valid child element. The project still loads and builds, but this concerned me. Anyway, the point behind this was to override the default of using "Web.config" for the config files.
My second question is much more basic - how do I test these transforms? This is a console app project inside a solution with several others, including a web application. The transforms I have to set up are App.TEST.config and App.PROD.config. How can I cause
the TEST/PROD configs to be generated so I can check they're working correctly?
Sep 16, 2016 01:52 PM|RichardY|LINK
The AppSettings element of the web.config has a file attribute you can use to include settings from an external file.
<add key="webpages:Version" value="220.127.116.11" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
I use an external appSettings file on my development machine but do any transforms directly in the <appSettings> element in the individual build configuration transforms.
You can test the transform in Visual Studio by right clicking in Solution Explorer and selecting Preview Transform from the context menu. For instance if you want to check the transform for the Release build, right click on Web.Release.config and select
Sep 17, 2016 11:08 PM|Angie xu - MSFT|LINK
This is the reference in config file: