I want to use config transformation for custom files, if I replace ???
with MSDeployPublish
, the Preview
functionality is not working and it replaces the local files in solution. However the publish works without using Preview
keeping local files untouched.
Config files:
AppSettings.config
└AppSettings.Test.config
└AppSettings.Stage.config
└AppSettings.Release.config
ConnectionString.config
└ConnectionString.Test.config
└ConnectionString.Stage.config
└ConnectionString.Release.config
What is the correct name of the target to use transformation for preview (without changing the files in soulution)? The way that web.config
works when making preview with webDeploy
<Target Name="???">
<TransformXml Source="App_Config\AppSettings.config" Destination="App_Config\AppSettings.config" Transform="App_Config\AppSettings.$(Configuration).config" />
<TransformXml Source="App_Config\ConnectionStrings.config" Destination="App_Config\ConnectionStrings.config" Transform="App_Config\ConnectionStrings.$(Configuration).config" />
</Target>
I don't want to use any extensions like SlowCheetah, just build in functionalities.
<Target Name="Build">
also works
UPDATE 1
I've succeeded to publish without change local config files:
Destination="$(_PackageTempDir)\App_Config\ConnectionStrings.config"
But the Preview still not transforming the configs (also when I define a message for output it is not appear). What black magic happens when I click "Preview", in the publish screen ?
I've tried with targets: TransformWebConfigCore
,CopyAllFilesToSingleFolderForPackage
,GatherAllFilesToPublish