When I publish a release version through web deployment, I get an error

I had something strange. I use the web.config conversion files, and when I try to publish to the local iis as a web deployment, I get the following error:

Error 1160 The ParameterizeTransformXml task completed unexpectedly. System.UriFormatException: Invalid URI: URI is empty. in System.Uri.CreateThis (String uri, Boolean dontEscape, UriKind uriKind) in System.Uri..ctor (String uriString) in Microsoft.Web.Publishing.Tasks.ParameterizeTransformXml.Execute ()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (ITaskExecutionHost taskExecutionHectTecTecTecTech Task, TaskLoggingTaskTech Task, TaskLogging Task Task, TaskLogging Task Task, TaskLogging Task Task, TaskLogging Task Task, TaskLogging TaskNode, TaskLogging TaskNode

It worked before I added some image files to the project, and it works in debug mode, when the conversion files are basically still identical.

Has anyone come across this and knew what could be causing this?

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

+4
source share
3 answers

I had the same error message. This happened after I copied in a new version of web.config that someone made many manual changes to another environment.

I found the problem using quasi-bin search. That is, using Beyond Compare, I would copy in the first half of the changes and look, still generate an error. If this happened, I would start again and only copy in the first quarter of the changes, etc.

The error for me was the following setup:

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

Pay attention to the symbol "more"!

I installed it by changing the setting to:

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

It is possible that something edited the configuration file, either the main web.config (most likely), or the conversion, and also can switch the encoding format from ANSI to UTF8 or similar and mixed up with escaped characters.

I noticed this only when saving the current and old versions as files and using comparative data comparison. Beware that the previous comparison using copy-paste in each comparison window did not show a problem, so compare the files.

+1
source

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

0
source

Source: https://habr.com/ru/post/1342738/


All Articles