views:

132

answers:

1

I have a windows service that will need to have the same kind of transformations that the web.configs would use, but VS 2010 doesn't seem to support that. I've tried manually adding the App.Release.Config files, and then using msbuil [PROJ] /T:TransformWebConfig /p:Configuration=Release but no transformation is performed. I got a TransformWebConfig folder createed in my obj subdirectory, but that's it.

Is this thing hardcoded to only work with web.configs?

A: 

Yes, the TransformWebConfig task is designed to work on web.config (File: $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets Line: 199)

But you could make it work by :

  1. Setting the Build Action of your App.config file to Content

  2. Setting the value of ProjectConfigFileName to App.config :

msbuild $ProjectFile$ /t:TransformWebConfig /p:ProjectConfigFileName=App.config;Configuration=Release

madgnome