Saturday, March 24, 2012

newbie: web.config problems

Dear reader!

asp.net 2.0

I have a problem with my settings in the web.config file.

This is part of my web.config file:
<roleManager enabled="true" cacheRolesInCookie="true"
cookieName="AHROLES" defaultProvider="AH_RoleProvider">
<providers>
<add name="AH_RoleProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=58e92a0497700d23" />
</providers>
</roleManager>

I get no compile errors, but when I run the website I get this error:
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=58e92a0497700d23' or one of
its dependencies. The system cannot find the file specified.

Source Error:

Line 52: connectionStringName="LocalSqlServer"
Line 53: applicationName="/"
Line 54: type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=58e92a0497700d23" />
Line 55: </providers>
Line 56: </roleManager>

Source File: C:\Documents and Settings\Test\My Documents\Visual Studio
2005\WebSites\HelloWorld\web.config Line: 54

Assembly Load Trace: The following information can be helpful to determine
why the assembly 'System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=58e92a0497700d23' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42

Any ideas what I'm missing here?Check the connection srings section. You should have a connection string
called LocalSQLServer. Not sure about the rest of it.

The Role manager, et al, can be a bugger to fix. I have had a bear of a time
with them. It is best to go through the docs on MSDN and look at each tag,
one at a time. You can then discern where the error is.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:eWoVp1E2GHA.4632@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Dear reader!
>
asp.net 2.0
>
I have a problem with my settings in the web.config file.
>
This is part of my web.config file:
<roleManager enabled="true" cacheRolesInCookie="true"
cookieName="AHROLES" defaultProvider="AH_RoleProvider">
<providers>
<add name="AH_RoleProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=58e92a0497700d23" />
</providers>
</roleManager>
>
I get no compile errors, but when I run the website I get this error:
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
>
Parser Error Message: Could not load file or assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=58e92a0497700d23' or one
of its dependencies. The system cannot find the file specified.
>
Source Error:
>
>
Line 52: connectionStringName="LocalSqlServer"
Line 53: applicationName="/"
Line 54: type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=58e92a0497700d23" />
Line 55: </providers>
Line 56: </roleManager>
>
>
Source File: C:\Documents and Settings\Test\My Documents\Visual Studio
2005\WebSites\HelloWorld\web.config Line: 54
>
Assembly Load Trace: The following information can be helpful to determine
why the assembly 'System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=58e92a0497700d23' could not be loaded.
>
>
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
>
>
>
>
>
------------------------
>
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42
>
>
Any ideas what I'm missing here?
>

0 comments:

Post a Comment