Monday, March 26, 2012

Web.Config parsing errors with Web App projects using IIS

Has the Schema of the Web.Config changed in Web App Projects? After
converting my 2005 Web Site project to a 2005 WAP, and switching to IIS
Web Server, I am getting a number of errors at run time in my web.config
files starting with:
Unrecognized attribute 'type'.
This error occurs when parsing the web.config file where first highlighted
below.
I do not see the referenced type in the GAC
(System.Configuration.ApplicationSettingsGroup), should it be there?
System.Configuration and System.Configuration.Install is referenced by the
project. If I remove the type parameter and value, I get the error:
Unrecognized attribute 'requirePermision'.
It appears 'requirePermision' parameter is no longer used, so when I remove
it,
I get an error with ConectionStrings section!!
Unrecognized configuration section 'connectionStrings'
I am including part of the config file that appears to be causing the error,
modified
only to hide connection string passwords etc. This error does not seem to
occur
when using Development Server. BTW I followed the steps provided by Scott
Guthrie to convert from WSP to WAP.
<configuration>
<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectio
nHandler,Microsoft.ApplicationBlocks.ExceptionManagement,Version=1.3.0.0,Cul
ture=neutral,PublicKeyToken=2e54ea205fb0
17a3"/>
<sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0
,
Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="SponsorWeb.My.MySettings"
type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"
/>
</sectionGroup>
</configSections>
<connectionStrings>
<clear/>
<add name="ABC" connectionString="data source=(local);initial
catalog=ABC;user id=NotReal;password=NotReal;persist security
info=True;pooling=true"/>
</connectionStrings>
...
</configuration>IIS virtual directories were set to 1.1 instead of 2.0.
"David Williams" wrote:

> Has the Schema of the Web.Config changed in Web App Projects? After
> converting my 2005 Web Site project to a 2005 WAP, and switching to IIS
> Web Server, I am getting a number of errors at run time in my web.config
> files starting with:
> Unrecognized attribute 'type'.
> This error occurs when parsing the web.config file where first highlighted
> below.
> I do not see the referenced type in the GAC
> (System.Configuration.ApplicationSettingsGroup), should it be there?
> System.Configuration and System.Configuration.Install is referenced by the
> project. If I remove the type parameter and value, I get the error:
> Unrecognized attribute 'requirePermision'.
> It appears 'requirePermision' parameter is no longer used, so when I remov
e
> it,
> I get an error with ConectionStrings section!!
> Unrecognized configuration section 'connectionStrings'
> I am including part of the config file that appears to be causing the erro
r,
> modified
> only to hide connection string passwords etc. This error does not seem to
> occur
> when using Development Server. BTW I followed the steps provided by Scott
> Guthrie to convert from WSP to WAP.
> <configuration>
> <configSections>
> <section name="exceptionManagement"
> type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSect
ionHandler,Microsoft.ApplicationBlocks.ExceptionManagement,Version=1.3.0.0,C
ulture=neutral,PublicKeyToken=2e54ea205f
b017a3"/>
> <sectionGroup name="applicationSettings"
> type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0
.0,
> Culture=neutral, PublicKeyToken=b77a5c561934e089" >
> <section name="SponsorWeb.My.MySettings"
> type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false
" />
> </sectionGroup>
> </configSections>
> <connectionStrings>
> <clear/>
> <add name="ABC" connectionString="data source=(local);initial
> catalog=ABC;user id=NotReal;password=NotReal;persist security
> info=True;pooling=true"/>
> </connectionStrings>
> ...
> </configuration>
>

0 comments:

Post a Comment