1

I got this error after I added NotFoundMvc in my project. If I remove NotFoundMvc I don't get this error. What should I change in Web.Config file?

enter image description here

Hacked user
  • 373
  • 1
  • 5
  • 20
  • Possible duplicate of [Web.config transformation: Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive](https://stackoverflow.com/questions/12737984/web-config-transformation-unrecognized-attribute-xmlnsxdt-note-that-attribu) – SimarjeetSingh Panghlia Jun 07 '17 at 06:23
  • sorry to say sir but that link didn't solve my problem – Hacked user Jun 07 '17 at 06:30

1 Answers1

1

First of all check the given line is there within the top of your transform file.

<?xml version="1.0"?>

If it 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

Jay Patel
  • 2,341
  • 2
  • 22
  • 43
  • This solved my problem. Can you please explain why should xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" be removed? Thanks sir. – Hacked user Jun 07 '17 at 06:36
  • That line should not in your primary web.config file. This is the line for a web.config transformation 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. – Jay Patel Jun 07 '17 at 06:44
  • Your parent web.config file should start with and none of the xmlns:xdt stuff. Your sub web.config files (those used for transforming your parent web.config file) should start with that line. – Jay Patel Jun 07 '17 at 06:44