10 December 2011 duplicate; DotNetOpenAuth CI Team

A little hint about what to do if you receive this error.

Following setup for me:

- Asp.NET MVC project including .NET Framework 4.0

- DotNetOpenAuth via NuGet installed

- The Webprojects also used “Cassini”

During the deployment to an ordinary IIS I received this error message:

“There is a duplicate ‘uri’ section defined”

This line was marked in red:

<section name=”uri” type=”System.Configuration.UriSection, System, Version=2.0.0.0,Culture = neutral, PublicKeyToken=b77a5c561934e089” />

image

Solution

(Very easy Zwinkerndes Smiley) Delete the following line from your own Web.config:

<section name=”uri” type=”System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ />

Reason: This entry is already included into the machine.config of .NET 4.0 applications so it would be double.

The Problem is only in connection with IIS and IIS Express. “Cassini” doesn’t recognize it at all (unfortunately). This Hint is, like almost every time from Stackoverflow (but in my opinion the best answer is a little bit too complicated so I decided to write this blogpost Zwinkerndes Smiley)