Why is ServiceModel sometimes declared in the Framework Web.config folder, and sometimes not?

We are deploying an ASP.NET 4.0 web application that has this declaration in the section of <httpModules>its Web.config file:

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>

In most cases, this is both wonderful and necessary. However, on two installations, we got an error below about duplicate entries. In two installations that had this error, we found that this declaration already exists here:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config

For installations that do not have an error, most installations do not have this line in the above file. Why is the Framework Web.config file incompatible with all installations? We have not yet been able to determine the exact difference. These are mainly servers with Windows Server 2003 or Windows Server 2008, as well as with some test fields with Windows 7. Working installations are a combination of the above, two non-working ones are Windows Server 2008 and Windows 7. All installations have a full profile installed. NET 4.

Error Details

IIS Web Core Module

BeginRequest Notification

Handler not yet defined

Error Code 0x800700b7

Configuration error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ServiceModel'

Configuration File \\?\C:\Inetpub\wwwroot\web.configRequested URL http://localhost:80/Physical Path C:\Inetpub\wwwrootLogin Method Login Not yet determinedUserNot yet determined

98: <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>

+5
source
1

( .NET Framework) Windows:

Microsoft.NET Framework 3.5.1 → HTTP Windows Communication Foundation

HTTP- WCF WCF IIS. WCF, script .svc ..

+3

All Articles