Web configuration error: unrecognized attribute "xmlns: xdt". Please note that attribute names are case sensitive.

I am trying to deploy the application to AppHarbor and follow their instructions on how to change my web.config, so it uses its own auf Sql server instance.

When I launch the solution, I get the error mentioned in the topic:

Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive. 

The only thread I found about this problem was this one . But adding pre-build lines and removing the obj folder and rebuilding did not bring any solution. He continues to work on this exception on the line:

 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 

Thanks in advance.

+7
asp.net-mvc appharbor web.config-transform
source share
3 answers

I would check that you have the following line at the top of your conversion file.

 <?xml version="1.0"?> 

If you confirm that there is, I would also check that the following is not in your actual converted web.config.

 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 

I found the web essentials extension invaluable for fixing such errors before deployment.

You can simply right-click your conversion file and select a preview from Visual Studio, and if you encounter any problems, you can investigate / fix it locally.

Website Basics 2012

http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6

+7
source share

Make sure the line throws an error:

 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 

Not located in your main web.config file. This is the line for the web.config conversion file. Basically, when you create a new project, you will get a Web.config file with one or more sub web.config files, named according to the build profiles for your solution, for example:

 Web.config Web.Release.config Web.Debug.config 

Your parent web.config should start with <configuration> and not one of the xmlns:xdt . Your sub web.config files (those used to convert the parent web.config file) should begin with this line.

If you are not familiar with web.config conversions, this allows VS to automatically change the elements of your configuration depending on the type of project assembly (used to change connection strings, enable or disable debugging, etc.).

Also, please check out the blogs at AppHarbor for instructions on working with Web.config conversions. Having never used AppHarbor, it seems that you may need to make small changes to the project for the transforms to work correctly. Finally, you may need to ensure that your web.config conversion files are indeed included in the build / deploy to the application harbor

+13
source share

Tommy's very clear description of the transformation process allowed me to solve a very stubborn problem. I have an ASP.NET MVC 4 project that threw an error when I tried to publish from Visual Studio 2012. I kept getting the error

 Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive. 

The error is indicated in the web.config file, but in fact it is not. It was at Web.Release.Config. I tried many of the recommended solutions in Converting Web.config: the unrecognized attribute 'xmlns: xdt'. Please note that attribute names are case sensitive.

I deleted the contents of the obj directory and worked once or twice and then stopped working. I removed the attribute from Web.Release.Config,

 xmlns:xdt=http://schemas.microsoft.com/XML-Document-Transform 

but it gave me errors. I tried

 This is kind of a workaround, but you may add the following line to your pre-build commands: del $(ProjectDir)obj\* /F /S /Q Right click your project > Properties > Build Events > Pre-build. 

This worked once, but not the second time.

I tried a longer version of the above solution

 del "$(ProjectDir)obj\*" /F /Q del "$(ProjectDir)obj\$(ConfigurationName)\AspnetCompileMerge\*" /F /S /Q del "$(ProjectDir)obj\$(ConfigurationName)\CSAutoParameterize\*" /F /S /Q del "$(ProjectDir)obj\$(ConfigurationName)\Package\*" /F /S /Q del "$(ProjectDir)obj\$(ConfigurationName)\ProfileTransformWebConfig\*" /F /S /Q del "$(ProjectDir)obj\$(ConfigurationName)\TempPE\*" /F /S /Q del "$(ProjectDir)obj\$(ConfigurationName)\TransformWebConfig\*" /F /S /Q 

but it gave me a lot of mistakes. The partner doctor had an interesting promising solution, but I needed to download a preliminary version of the software from GitHub, and I did not want to risk it if I did not have to. http://blogs.thesitedoctor.co.uk/tim/Trackback.aspx?guid=7988f7bc-947c-4134-ab52-af22770b639c Then I found Tommy's article and it gave me an idea. I removed this xmlns:xdt=http://schemas.microsoft.com/XML-Document-Transform from this line

 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 

When I did this, I had to remove

 xdt:Transform="RemoveAttributes(debug)" 

from this line

 <compilation xdt:Transform="RemoveAttributes(debug)" /> 

It worked for me. This is probably a great idea to remove a transform that seems to remove debug attributes when publishing / releasing your project, but seems to fix the problem.

+2
source share

All Articles