开发者

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.


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;|[]" />


Something may have edited a config file, either the main web.config (most likely) or a transform and also may have switching the encoding format from ANSI to UTF8 or similar and messed with escaped characters.

I only spotted it when saving the current and an older version as files and using beyond compare data comparison. Beware that previous comparison using copy-paste into each comparison window didn't show the problem, so compare using files.


Change the file encoding to UTF8 with windows line breaks. This can be done by visiting File > Advanced Save Options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜