Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

While publishing a release version through web-deploy I get an error

I had something odd happening. I use web.config transformation files, and when trying to publish to a local iis as a web-deployment, I get the following error:

Error 1160 The "ParameterizeTransformXml" 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.ParameterizeTransformXml.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)

It did work before I added some image files to the project, and it does work in debug mode when the transformation files are basically still identical.

Did anyone encounter this and know what might be causing this?

This is under visual studio 2010 and framework 4.0, Windows 7.

like image 203
Yaniv Avatar asked Mar 08 '11 01:03

Yaniv


1 Answers

I had the same error message. It occurred after I copied in a new version of a web.config that someone had made many changes to manually in other environment.

I found the issue using a quasi-binary search. I.e. Using Beyond Compare, I would copy in the first half of the changes and see if it still generated the error. If it did, then I would start again and only copy in the first quarter of the changes etc...

The error for me was the following setting:

<setting name="InvalidItemNameChars" value="\/:?&quot;&lt;>|[]" />

Note the "greater than" symbol!

I fixed it by changing the setting to:

<setting name="InvalidItemNameChars" value="\/:?&quot;&lt;&gt;|[]" />
like image 73
Brian Hinchey Avatar answered Oct 02 '22 23:10

Brian Hinchey