This repository has been deprecated and is no longer being tracked. For current SlowCheetah development, go to the Microsoft SlowCheetah repository.
For more info on this change, see #246
XML Transforms for app.config and other XML files
License: Other
This repository has been deprecated and is no longer being tracked. For current SlowCheetah development, go to the Microsoft SlowCheetah repository.
For more info on this change, see #246
Before a solution is loaded the transform commands show up in the Project menu. See https://dl.dropbox.com/u/40134810/bugs/SlowCheetah/preview-in-proj.png
When a dependent project isbuilt SlowCheetah should ensure the transformed config file is copied to the output folder. One technique to do this is described at http://blogs.clariusconsulting.net/kzu/how-to-apply-build-configuration-transformations-on-non-web-projects/
For setup project we need to ensure that transformations for non-app.config files are actually included in the MSI which is generated.
Hi,
I'm using VS2010 with last extension version and meet the following error :
obj\release\csautoparameterize\original\web.config(41): error ASPCONFIG: L'utilisation d'une section inscrite comme allowDefinition='MachineToApplication' au-delà du niveau d'application est une erreur. Cette erreur peut provenir d'un répertoire virtuel non configuré en tant qu'application dans IIS.
Sorry, the error message is in french.
Step to reproduce:
To fix it, I have to delete all subfolders un \obj directory.
Thanks
David
In VS2010 I'm getting the following warning when using SlowCheetah:
SlowCheetah.Transforms.targets (170): The target "CopyAllFilesToSingleFolderForPackage" does not exist in the project.
This is because the target CopyTransformFilesWap relies on CopyAllFilesToSingleFolderForPackage but it no longer exists.
If you have the following setup:
The transformed foo.xml does not make it to the output folder for ClassLibraryA, it should.
Add Transform should appear again when new build configurations are added (as per VS2012)
Reproduction steps:
In the samples we should have a sample web project.
When you have a config file that already has transform files but for some reason does not have the correct config in the csproj file (lost on merge, etc.) then clicking Add Transform does nothing.
What it should do is look through the csproj file and check if those files have the correct config and if not, apply it.
I don't want my transforms to be tied to project configurations such as "Debug" or "Release". I rather want something like "Foo.config". I'd also be willing to go with a convention of using a prefix to match the transformed file, such as "App.Foo.config".
However this isn't working for me.
I used the plugin to generate the default transforms and files, then manually modified the csproj and file names like here:
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
<TransformOnBuild>true</TransformOnBuild>
</None>
<None Include="App.Foo.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
...
</ItemGroup>
The preview function displays the XML output as I would expect it.
Unfortunately, after I build the project, none of the expected files are generated. I can see this in the output window:
Target "DiscoverFilesToTransform" in file "C:\Users\me\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets" from project "X:\Path\To\My\Project.csproj" (target "TransformAllFiles" depends on it):
Done building target "DiscoverFilesToTransform" in project "Project.csproj".
Target "TransformAllFiles" in file "C:\Users\me\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets" from project "X:\Path\To\My\Project.csproj" (target "Build" depends on it):
Task "MakeDir" skipped, due to false condition; (Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)')
and '%(Link)'=='' ) was evaluated as (Exists('.Debug')
and ''=='' ).
Task "MakeDir" skipped, due to false condition; ( '%(Link)'!='' ) was evaluated as ( ''!='' ).
Task "SlowCheetah.Tasks.TransformXml" skipped, due to false condition; ( Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)') ) was evaluated as ( Exists('App.Debug.config') ).
Task "SlowCheetah.Tasks.TransformXml" skipped, due to false condition; ( Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)')
and '%(Link)'=='' ) was evaluated as ( Exists('.Debug')
and ''=='' ).
Task "SlowCheetah.Tasks.TransformXml" skipped, due to false condition; (Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)')
and '%(Link)'!='' ) was evaluated as (Exists('.Debug')
and ''!='' ).
Done building target "TransformAllFiles" in project "Project.csproj".
I couldn't make much sense from the SlowCheetah MSBuild task on first glance. I get the feeling that this won't work because my files aren't named like my project build configuration.
Am I missing something here? How can I use files that are not named like the build configurations?
Right now there is a functionality to view only the current transform , it should be extended to visualize/compare all the transform
of the file.
i.e. after clicking "visualize all transform" context menu button on web.config one should be able to view web.config and its all transformations side by side in a tool like beyond compare 3(n) way compare/merge
The WCF service project uses an App.config file but when published via VS.NET it gets published to a web.config file. Slow Cheetah does not transform that web.config file. It does perform a transform on the application.exe.config file in the /bin output folder. In my case, I was expecting the web.config file to be transformed instead since I am deploying my WCF service alongside my web application which is also being published similarly.
In the Sample SlowCheetah.Samples the connectionStrings.config is a linked file. When building the setup project associated with it there is a build error. Linked files are not handled correctly with setup projects.
If you are interested in this vote for it at http://slowcheetah.uservoice.com/forums/185106-general/suggestions/3385389-support-for-transforming-web-config-on-f5, we are only working on the most voted items
Figure out a way to make this work for web projects on F5.
The Add Transform command should not show up for .pubxml files.
After switching to VS 2012 RC, it doesn't look like SlowCheetah is transforming files when i publish to my development server. Files are still transforming in 2010 and were fine in 2011 Beta.
When a transform is added currently it is inheriting the Build Action of the original file. This is not the correct behavior, they should instead be added as None.
My project har some transformation I would like to do in my environment only, but shouldn't be tracked by the source control system.
The user should be able to add by context-menu "Add user transform", then it should add the files for each configuration and update the project accordingly
<None Include="web.Debug.config.user" Condition="Exists('web.Debug.config.user')" >
<DependentUpon>web.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
if the project file contains this configuration it should only add the files.
When the transformation takes place it should first perform the transformation from the web.Debug.config first and afterwards if the user file exists it should apply those transformations on the result from the previous transform result.
We currently do not support the preview feature when VS 11 is used. We should leverage the built in diff tool which VS 11 has for this.
When a transform is added if the source file is marked to copy local there are issues in that the original file may be copied on top of the transformed file. This should be fixed but we need to ensure that the source file is copied to the output directory for build configurations which do not have an associated transform.
If I have a config file and its associated transform in a subdirectory (e.g., repository.config transformed by repository.debug.config in a config directory) below the root of my web project, then the transform file is unnecessarily copied to the location of the transformed file. Ideally, these config transforms would be removed or suppressed.
I have not checked if this behavior occurs with other project types, so I don't know if these files would be copied to, say, bin\Debug.
Before Slow Cheetah, I had my projects modified to perform transforms, and I included the following in my build files (probably from one of your blog posts) to help clean up after the publish process:
<Target Name="CustomExcludeFiles" BeforeTargets="ExcludeFilesFromPackage">
<ItemGroup>
<ExcludeFromPackageFiles Include="Config\**\*.*.config" />
</ItemGroup>
</Target>
Currently we do not support preview for custom transforms in web.config. We should consider supporting this if possible.
If you care about this feature vote for it at http://slowcheetah.uservoice.com/forums/185106-general/suggestions/3385316-add->the-concept-transformconfig, we are only working on the most voted items
Web Projects support the concept of publish profiles, and have the concept of a profile specific transform. The transforms are executed in the following way.
Web. config -> web. {BuildConfig}.config->web.{PublishProfile} .config
If the transform file is not present, the transform is simply skipped.
SlowCheetah should add this Concept to other projects as well. Instead of it being publish related we should introduce the concept of a TransformConfig. We will need the following support:
-Each project will have its own list of transform config values
-The list of possible values will be stored in an MSBuild item list named ScTransformConfigs
-The value for the current transform config will be passed in the property ScTranstormConfig
-There will be a solution wide setting in VS
-We should create a gesture for the user to set the current TransformConfig valve
-On build in VS we should pass in this value
-When a user invokes Add Transform the transform config files will be added as well
This should work with linked files as well
I am encountering the same problem as this one on Stack Overflow:
http://stackoverflow.com/questions/11201912/slowcheetah-not-working-after-installation-of-azure-sdk
Essentially, after installing the Azure SDK and trying to Web Publish, configs other than web.config are not being transformed.
If you have a transform with an extra '.' in the file name the Preview Transform command will not show up. For example if you have a build config named "QA.01" and then use Add Config Transforms to add web.QA.01.config then the Preview command will not show up for web.QA.01.config.
Web projects now support transforms based on the publish profile, SlowCheetah should respect this for files other than web.config.
I have a MSBuild file that contains a couple of MSBuild transformations. I want to transform this file with an XML transformation, but the problem is that the transformation fails, because an attribute value contains a greater than symbol > (coming from the MSBuild transformation ->). Also the thrown exception is ambiguous: System.UriFormatException: Invalid URI. If I XML encode the symbol everything works - but it should work out of the box in the first place.
Do you plan to open-source the code for the MSBuild tasks as well (SlowCheetah.Tasks.dll)?
VS2012
I have a connectionstrings.config file. I add a transform to this and now have connectionstrings.release.config. I set it up and it works fine in preview mode.
I then publish my website project (with precompile) to a local folder.
The connectionstrings.config file is not transformed - in fact it has not been modified at all and is the original date/time of the connectionstrings.config file in the project.
Have I done something wrong?
When publishing to the file system XML files are not being transformed. See #16 (comment) for more details.
The default App.config always persist after publish
We should have support for web setup projects.
Just a suggestion.
I have a team project which is using the CustomAfterMicrosoftCommonTargets to add the SlowCheetah targets into all output projects from source control.
Everytime I use the right click context menu to add a transform, the slow cheetah extension tries to modify the project file and add the local version of the script.
Using SlowCheetah.Tasks 1.0.10727.0, if an XmlException is thrown in TransformXml.Execute, the catch block will try to parse a URI from the exception instance's Source property. When that property is blank, a UriFormatException is thrown.
This bug causes an unhandled exception to be thrown by the task and the finally block incorrectly reports "Transformation succeeded".
in a web project if we have transformation files added manually and we click on the transformation config file we cannot see the
Preview transform action in context menu. For this we have to click on "add transform" in root config file and then the action item appears in the context menu of transform config file.
Clicking on Add transform modifies Project File that is not desired.
When custom files are being transformed we need to ensure that they are getting cleaned when the Clean target is exectued.
We should support transforms for Azure projects.
References:
http://www.olegsych.com/2010/12/config-file-transformation/
If you care about this vote at http://slowcheetah.uservoice.com/forums/185106-general/suggestions/3385380-add-support-for->silverlight, we are only working on the most voted items
Add support for Silverlight. See the thread "Silverlight not working" at http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5.
As far as I know, in VS2010 I could have a publish profile called Testing and create config transform files called .Testing.config.
If I manually change the name of .Release.config to .Testing.config and I use a publish profile names Testing, the config transform doesn't occur (although VS2012 supports this for Web.Testing.config).
The build configuration of the publish profile is set to Release, but both my Testing and Live publish profiles use Release as the build config.
Can we support transforms for website project via Web deployment projects?
Today we have a default value for SlowCheetahTargets which gets inserted into the project file. It would be nice if this could be customized so that users don't have to continually edit the project file to update the value.
When a preview is kicked off we should be saving both the transform file itself as well as the file being transformed. Currently neither are being saved before preview.
Here's the scenario:
Created a web app. Added a class project with app.config. Added transform for app.config. Build.
Added a web site project - reference the class. Add transform to web.config. Build.
Create publishing profile for Release level. Publish release level. The web.config on the server is correctly transformed, but the app.config must not be because what the website displays is the settings before transform. I looked at the bin/release/class.dll.config and it looks ok.
I also tried setting the app.config to copy to output - copy always. Same result.
As a last effort, i changed the base app.config to the values i wanted. Build. Publish. Base config values not used. That really confused me.
Any suggestions? (BTW-Thanks for creating this)
The Add Transform should not show up for .settings files.
For VS 2012 Sql Server Database projects there is no Add Transform menu item for .xml files, like it is in other project types.
This would be really handy to have transforms for database publish profiles.
Hi!
I have a issue with custom configs, that added to the 'Azure Worker Role' project. I tryed to move connection strings declaration in the separate file and apply transformations to this file.
When I build or rebuild solution - all works fine. But when I run - I am getting following error:
Error 1 The item "bin\Debug\connectionStrings.config" in item list "OutputGroups" does not define a value for metadata "TargetPath". In order to use this metadata, either qualify it by specifying %(OutputGroups.TargetPath), or ensure that all items in this list define a value for this metadata. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets 1663 5 SlowCheetahAzure
I use the .NET Framework 4.5, Windows Azure SDK for .NET 1.8 and MSVS 2012.
Also I make the test solution that you could use to reproduce this issue:
https://dl.dropbox.com/u/24442837/Builds/SlowCheetahAzure.zip
P.S.: One more man experienced this issue when try to use custom 'NLog' config with 'Azure' project:
When uninstalling SlowCheetah the files at %localappdata%\AppData\Local\Microsoft\MSBuild\SlowCheetah, they need to be removed.
When transforming the output is stripped from any XMLNS:X tags which had been added to the xml element.
Here is the Transform bit:
<diagnostics xdt:Transform="Replace">
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true">
<filters>
<add nodeQuota="50" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
/s:Envelope/s:Header/a:Action[not(contains(text(),'/trust/'))]
</add>
</filters>
</messageLogging>
</diagnostics>
The resulting output is:
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true">
<filters>
<add nodeQuota="50">
/s:Envelope/s:Header/a:Action[not(contains(text(),'/trust/'))]
</add>
</filters>
</messageLogging>
Notice the missing:
xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"
On the Add element.
Web application project (vs2012 .net 4.5 asp.net mvc4).
Create an arbitrary config file at the project root, setup up transforms, set it to copy to output directory.
On publish, the file in the project root is transformed, while the copy moved into the output directory is not.
Not sure if this is intended/known behavior? Is there a work around?
When a project is published with ClickOnce and non-app.config files have a transformation the transformed file is not being published, the original one is.
I have version 2.4.1 which has a fix in this area, but when I package my azure worker project with a custom configuration "Dev", the resulting cspkg file does not contain the transformed file. Furthermore when packaging this warning is produced:
C:\Users\scott\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets(170,64): warning MSB4057: The target "CopyAllFilesToSingleFolderForPackage" does not exist in the project.
The project was created before I installed SlowCheetah, could it be that it is missing some sections?
When building from VS the output folder has the correctly transformed file.
Scott
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.