Config transformations and “TransformXml task failed” error message

11,394

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

Share:
11,394
Troy Hunt
Author by

Troy Hunt

Pluralsight author. Microsoft Regional Director and MVP for Developer Security. Online security, technology and “The Cloud”. Creator of Have I Been Pwned.

Updated on June 03, 2022

Comments

  • Troy Hunt
    Troy Hunt almost 2 years

    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 unexpectedly. System.UriFormatException: Invalid URI: The URI is empty. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
    at System.Uri..ctor(String uriString) at Microsoft.Web.Publishing.Tasks.TransformXml.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost 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?

  • Dejan
    Dejan almost 14 years
    Same issue here with a .NET 3.5 WCF service. Your solution worked a treat.