Monday, March 26, 2012

newbie: Need help with this bug/exception

Hey

ASP.NET 2.0

this code "private MembershipUserCollection allUsers =
Membership.GetAllUsers();" crashes my web portal. Below you see the inner
exception

Innet Exception:

System.Configuration.ConfigurationErrorsException was unhandled by user code
Message="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its dependencies.
The system cannot find the file specified. (C:\\Documents and
Settings\\Test\\My Documents\\Visual Studio 2005\\WebSites\\Test\\web.config
line 53)"
Source="System.Web"
BareMessage="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its dependencies.
The system cannot find the file specified."
Filename="C:\\Documents and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config"
Line=53
StackTrace:
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, XmlNode node,
Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, Boolean
checkAptcaBit, Boolean ignoreCase)
at
System.Web.Configuration.ProvidersHelper.Instantia teProvider(ProviderSettings
providerSettings, Type providerType)
at
System.Web.Configuration.ProvidersHelper.Instantia teProviders(ProviderSettingsCollection
configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32
pageSize, Int32& totalRecords)
at System.Web.Security.Membership.GetAllUsers()
at Admin_Default..ctor() in c:\Documents and Settings\Test\My
Documents\Visual Studio 2005\WebSites\Test\Admin\Default.aspx.cs:line 14
at ASP.admin_default_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.0.cs :line 0
at
__ASP.FastObjectFactory_app_web_suvoevfs.Create_AS P_admin_default_aspx() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.2.cs :line 0
at System.Web.Compilation.BuildResultCompiledType.Cre ateInstance()
at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)

This is my membership provider (web.config)

<membership defaultProvider="AH_MembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add name="AH_MembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindows="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' " />
</providers>
</membership>

Any suggestions on how to solve this problem?

Best Regards

JeffThere are instances where you need to strip out the garbage from a site,
esp. if you publish instead of just copy all source (the latter being a bad
thing in a production site). Open the web config and remove the assemblies
add lines for the dlls in question (under <compilation>). If you have
already compiled (published), they are not needed anyway. That is what I
would try first. If it does not work, follow up and the issue can be dug
into deeper.

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

*************************************************
Think outside of the box!
*************************************************
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:uwrVWnR3GHA.1568@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hey
>
ASP.NET 2.0
>
this code "private MembershipUserCollection allUsers =
Membership.GetAllUsers();" crashes my web portal. Below you see the inner
exception
>
Innet Exception:
>
System.Configuration.ConfigurationErrorsException was unhandled by user
code
Message="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its
dependencies. The system cannot find the file specified. (C:\\Documents
and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config line 53)"
Source="System.Web"
BareMessage="Could not load file or assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one
of its dependencies. The system cannot find the file specified."
Filename="C:\\Documents and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config"
Line=53
StackTrace:
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, XmlNode node,
Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, Boolean
checkAptcaBit, Boolean ignoreCase)
at
System.Web.Configuration.ProvidersHelper.Instantia teProvider(ProviderSettings
providerSettings, Type providerType)
at
System.Web.Configuration.ProvidersHelper.Instantia teProviders(ProviderSettingsCollection
configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32
pageSize, Int32& totalRecords)
at System.Web.Security.Membership.GetAllUsers()
at Admin_Default..ctor() in c:\Documents and Settings\Test\My
Documents\Visual Studio 2005\WebSites\Test\Admin\Default.aspx.cs:line 14
at ASP.admin_default_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.0.cs :line 0
at
__ASP.FastObjectFactory_app_web_suvoevfs.Create_AS P_admin_default_aspx()
in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.2.cs :line 0
at System.Web.Compilation.BuildResultCompiledType.Cre ateInstance()
at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
>
>
This is my membership provider (web.config)
>
<membership defaultProvider="AH_MembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add name="AH_MembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindows="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' " />
</providers>
</membership>
>
Any suggestions on how to solve this problem?
>
Best Regards
>
Jeff
>
>

0 comments:

Post a Comment