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
- 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=220.127.116.11,Culture = neutral, PublicKeyToken=b77a5c561934e089” />
(Very easy ) Delete the following line from your own Web.config:
<section name=”uri” type=”System.Configuration.UriSection, System, Version=18.104.22.168, 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 )