Solved

SqlMembershipProvider provider error: Could not load file or assembly 'System.Web'

Posted on 2007-03-22
2
1,064 Views
Last Modified: 2008-02-01
I'm trying to create a .NET 2.0 application using the default SqlMembershipProvider provider. I can't seem to get my 'type' statement right in web.config. At the moment I am testing the following script which is an adaptation of an approach documentd on msdn:

<membership defaultProvider="NCACCHSqlConnection" >
      <providers>
            <clear/>
            <add name="NCACCHSqlConnection"
            connectionStringName="NCACCHSqlConnection"
            applicationName="NCACCH"
            passwordFormat="Clear"
            type="System.Web.Security.SqlMembershipProvider,
                                        System.Web, 2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      </providers>                  
</membership>

When I attempt to login I can see my application is somehow talking to my SQL Server because it is updating the LastLoginDate field. However I get the following error and I'm stuck:

Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

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' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 100:                        applicationName="NCACCH"
Line 101:                        passwordFormat="Clear"
Line 102:                        type="System.Web.Security.SqlMembershipProvider, System.Web, 2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
Line 103:            </providers>                  
Line 104:      </membership>
 

Source File: C:\Documents and Settings\Michael\My Documents\Visual Studio 2005\WebSites\WebSite1\web.config    Line: 102

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web' could not be loaded.

If I modify the 'type' declaration by removing  
           System.Web, 2.0.0.0, Culture=neutral, PublicKeyToken=nullinformation
I get a null exception error
Please help, this is driving me from drink
cheers
Verdy
0
Comment
Question by:verdante
2 Comments
 
LVL 21

Accepted Solution

by:
tovvenki earned 500 total points
ID: 18777521
Hi,
change the line
type="System.Web.Security.SqlMembershipProvider,
                                        System.Web, 2.0.0.0, Culture=neutral, PublicKeyToken=null"/>

to

type="System.Web.Security.SqlMembershipProvider"

Kind Regards
Venki

0
 

Author Comment

by:verdante
ID: 18786557
Thanks for that Venki
I gave it a shot and received a Null error message. When I went back to my User record I realised that some fields had null entries. So I populated them and it all worked beautifully
cheers
Verdy
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now