asp.netasp.net-mvcappharborweb.config-transform

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


I am trying to deploy an application to AppHarbor and followed their instructions on how to modify my web.config, so it uses their instance auf Sql server.

Upon running the solution I am getting 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 the pre build lines and deleting the obj folder and rebuilding did not bring any solution. It keeps running into this exception at the line:

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

Thank you in advance.


Solution

  • I would check that you have the following line within the top of your transform file.

    <?xml version="1.0"?>
    

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

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

    I have found the web essentials extension invaluable for resolving errors like this before I deploy.

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

    Web essentials 2012

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