I've a problem with my app.Debug.config file.
I followed completely your explanations, but the problem persist.
<?xml version="1.0" encoding="utf-8" ?>
<add key="Environment" value=""/>
My App.Debug.config file :
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using app.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<add key="Environment" value="Debug" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="Mytestkey" value="testonly"/>
When i build my project into the debug mode, the created Myapp.exe.config file is :
<?xml version="1.0" encoding="utf-8"?>
<add key="Environment" value="Debug"/>
Thanks for your help and this extension.
the build configs(App.Debug.Config, App.Release.Config etc.) are doing the transformations not adding new nodes to config.
if you want to change <add key="Mytestkey" value="testonly"/> add it to App.config and change it's value in the build configs
Not sure if this issue is the extension, or the standard MSbuild targets. If I create a VSTO project (Word add-in), use your extension to transform app.config depending on configuration, then use publish to deploy, it appears the config file included with the deployment is the original un-transformed app.config, not the transformed one generated in the build process. This is a pain, because it means I have to have a script to copy the correct config after I publish.
I'm tending to think it's an issue with the common msbuild targets, but I thought I'd ask here before I delve into that haystack.
Class library project(Word Add-In) is not is missing the AfterPublish target
It can be supported very easily
Unload Project-> edit wordaddin.csproj
After <Target Name="AfterCompile"…> and before </Project>
<!--Publish copies the untransformed App.config to deployment directory so overwrite it-->
<Copy Condition="Exists('$(DeployedConfig)')" SourceFiles="$(IntermediateOutputPath)$(TargetFileName).config" DestinationFiles="$(DeployedConfig)" />
Save file->Reload Project
Update me if it solved your issue I’ll include this change in my next release
As far as I remember and that’s why I have created this extension slow cheetah requires external assembly for transformation
If you work in teams that can become a problem since you cannot force others to install extensions
I picked again to this project and see that they solved this by using nuget package
Configuration Transform doesn’t requires any external dependencies or neget packages for others(including build servers) to build the transformations
My advice to you is to try them both and then decide which suits you best
try to get this to work in my vs2012 solution. the transformation is not happening when i build my solution. i did exactly how it was documented in the Description; just to test this. has anyone for sample of this?
well never mind...it works. just doesn't drop the file in to the project directory thereby preserving the main app.config. it does toss the file into the /project/bin/<target/ directory where it belongs.
my guess, upon looking the the profile file, is that you can get this to work by adjusting this variable: $(IntermediateOutputPath) in the project path.
Because VS2012 & VS2010 now can open the same solutions/projects, could it be better to change the UsingTask from this:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
idea took from this thread: http://msdn.microsoft.com/en-us/library/jj860450(v=vs.103).aspx
thanks for the tip against the msbuild, I will take in mind and actually in the build server maybe I need to push the library "Microsoft.Web.Publishing.Tasks.dll" as a custom dll, I don't know if on the team foundation service for example, there's that dll installed in that folder, i will check...
We have a logging.config file which needs transforming as well as the app.config however when I applied a transform to both app.config and logging.config it applied the logging.config over the top of app.config and without the transformation.
the Configuration Transform never intended for other transformations :)
the logging.config transformation overrides the app.config and being treated as the main config(app.config)
you have a point when breaking the logging configuration to have its own file
can you send me the project layout? I’ll try to push this in future release
I have a small issue with the VS 2012 support. When I invoked "Add Config Transforms" the proj file was updated with a build task that references $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll
which is not a valid path, it should be "v11.0". Once I edited that by hand everything worked great. Thanks