Categories configuration publishing visual-studio visual-studio-2010

Config transformations and “TransformXml task failed” error message

I’ve just enabled config transformations on a .NET 3.5 project in VS2010 RC after watching Scott Hanselman’s video on web deployment. Unfortunately every time I go to publish I now get the following error:

The “TransformXml” task failed
System.UriFormatException: Invalid
URI: The URI is empty. at
System.Uri.CreateThis(String uri,
Boolean dontEscape, UriKind uriKind)

at System.Uri..ctor(String uriString)
taskExecutionHost, TaskLoggingContext
taskLoggingContext, TaskHost taskHost,
ItemBucket bucket, TaskExecutionMode
howToExecuteTask, Boolean& taskResult)

If I take a brand new VS2010 web application which already has the config transformations by default I don’t have a problem so I suspect my issue is project related. Has anyone come across this before or have any ideas on a fix?

Looks like the answer was simple yet obscure; I had an app setting (a password), which contained a “>” symbol. I tried converting the app to .NET 4 then back to .NET 3.5 and everything ran fine as during the process the symbol had been escaped to “>”. Never had a problem with this character until config transformations came along but at least the fix is now simple.

Edit: blogged about in a bit more detail: Visual Studio 2010 Config Transformations TransformXml task failure