> ## Content Index
> Fetch the complete content index at: https://blog.tsd.digital/llms.txt
> Use this file to discover other available public pages before exploring further.

# Avoid Unrecognized attribute 'xmlns:xdt' configuration error
- URL: https://blog.tsd.digital/avoid-unrecognized-attribute-xmlnsxdt-configuration-error/
- Published: 2012-02-10T13:21:02.000Z
- Updated: 2012-02-10T13:21:02.000Z
- Author: Tim Gaunt
- Tags: ASP.Net, Development, .Net, #Import 2025-04-01 05:37

If you've been using web.config transformations or a nuget package with transformations in at all you'll no doubt have come across the runtime configuration error of "Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive" pointing at the start of the <configuration> node (if not see below). This one has been bugging me for a while so I thought I'd work a way around it. 

### Server Error in '/' Application. 

#### *Configuration Error*

Description: 

Parser Error Message: 

Source Error:

```plain
Line 1:  <?xml version="1.0" encoding="utf-8"?>
Line 2:  <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
Line 3:    <configSections>
Line 4:      <section name="Exceptioneer" type="Something, Assembly" requirePermission="true" />
```

**Source File:** c:\\domain.com\\web.config **Line:** 2

Version Information:

## The Solution

To work around this, I've assumed you're running some form of custom build already (or have access to add a pre-deploy build step).

1. Download and install the [MSBuild Community Tasks](http://msbuildtasks.tigris.org/?ref=blog.tsd.digital)
2. Add the new FileUpdate build step below which looks at your config file (you'll need to run this against each one). You'll also need to have a space in the ReplacementText as you can't currently replace with String.Empty.
3. You're done

<ItemGroup> <FileUpdateFiles Include="\*\*\\\*.config" /> </ItemGroup> <FileUpdate Files="@(FileUpdateFiles)" Regex=" xmlns\\:xdt\\=&quot;http\\://schemas\\.microsoft\\.com/XML-Document-Transform&quot;" ReplacementText=" " />

If you've got a better (automated) solution, please let me know, it's been bugging me for ages!