Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2008

Tip: Looking for answers? Try searching our database.

error when creating profile with modified provider

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mich - 30 Jan 2008 19:17 GMT
Hi,

I changed the default provider for usernames like this in web.config:

</connectionStrings>
<clear/>
<add name="myprovider" connectionString="Data Source=.\sqlexpress;Initial
Catalog=mydb;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>

<membership>
  <providers>
       <remove name="AspNetSqlMembershipProvider"/>
       <add name="AspNetSqlMembershipProvider"
       type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
       connectionStringName="myprovider"
       .......
    />
  </providers>
</membership>

This works: the created usernames (via CreateUserWizard control) are put
into tables created in database 'mydb'.

Now i also defined a profile properties in web.config like this:

<profile enabled="true">
     <providers>
       <clear/>
       <add name="AspNetSqlMembershipProvider"
            type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="myprovider"/>
      </providers>
     <properties>
       <add name="manager" type="System.Boolean"/>
     </properties>
   </profile>

When trying to create a new user with CreateUserWizard where i added a
checkbox, i get this 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: Provider must implement the class
'System.Web.Profile.ProfileProvider'.
Source Error:
Line 98:         <clear/>
Line 99:         <add name="AspNetSqlMembershipProvider"
Line 100:             type="System.Web.Security.SqlMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Line 101:             connectionStringName="myprovider"/>
Line 102:      </providers>
Source File: c:\inetpub\wwwroot\tennis\web.config    Line: 100

Why do i get this message when using profile and not otherwise? And how to
fix that?
Thanks
Mich
Dominick Baier - 30 Jan 2008 19:23 GMT
profile enabled="true">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

You want the AspNetSqlProfileProvider (not membership)

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> profile enabled="true">
> <providers>
> <clear/>
> <add name="AspNetSqlMembershipProvider"
> type="System.Web.Security.SqlMembershipProvider, System.Web,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Mich - 30 Jan 2008 20:04 GMT
Thanks for replying...
I did this: (i also changed type="System.Web.Profile.ProfileProvider)

<profile enabled="true">
     <providers>
       <clear/>
        <add name="AspNetSqlProfileProvider"
type="System.Web.Profile.ProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        connectionStringName="myprovider"/>
   </providers>
....

And now, i get the error: "Cannot create an abstract class"

> profile enabled="true">
> <providers>
[quoted text clipped - 17 lines]
>> type="System.Web.Security.SqlMembershipProvider, System.Web,
>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Peter Bromberg [C# MVP] - 30 Jan 2008 20:41 GMT
This might help:
http://weblogs.asp.net/bradleyb/archive/2006/05/08/445727.aspx

-- Pete
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> Thanks for replying...
> I did this: (i also changed type="System.Web.Profile.ProfileProvider)
[quoted text clipped - 32 lines]
> >> type="System.Web.Security.SqlMembershipProvider, System.Web,
> >> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Mich - 30 Jan 2008 21:45 GMT
Thanks, but i couldn't find any help there ...

The GotDotNet site is being phased out
  Microsoft will be phasing out most features of the GotDotNet site by July
2007.

        GotDotNet Workspaces and Private Workspaces have been phased out
a.. More about the GotDotNet phase-out
           a.. Contact the GotDotNet Support Team

I found a menu samples, but nothing about my problem.

> This might help:
> http://weblogs.asp.net/bradleyb/archive/2006/05/08/445727.aspx
[quoted text clipped - 40 lines]
>> >> type="System.Web.Security.SqlMembershipProvider, System.Web,
>> >> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Dominick Baier - 31 Jan 2008 06:11 GMT
it is not System.Web.ProfileProvider

it is

AspNetSqlProfileProvider
-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> Thanks for replying...
> I did this: (i also changed type="System.Web.Profile.ProfileProvider)
[quoted text clipped - 28 lines]
>>> type="System.Web.Security.SqlMembershipProvider, System.Web,
>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Mich - 31 Jan 2008 08:01 GMT
Thanks again but i still get an error.
I tried this:
<add name="AspNetSqlProfileProvider"
type="System.Web.AspNetSqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, Pud blicKeyToken=b03f5f7f11d50a3a"
connectionStringName="myprovider"/>

The error:
Could not load type 'System.Web.AspNetSqlProfileProvider' from assembly
'System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.

and this:
<add name="AspNetSqlProfileProvider"
type="AspNetSqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="myprovider"/>

The error:
Could not load type 'AspNetSqlProfileProvider' from assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

> it is not System.Web.ProfileProvider
>
[quoted text clipped - 39 lines]
>>>> type="System.Web.Security.SqlMembershipProvider, System.Web,
>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Dominick Baier - 31 Jan 2008 08:51 GMT
simply copy and modify the provider section from your machine.config (in
\windows\microsoft.net\framework\version\config

it's:

<profile>
     <providers>
       <add name="AspNetSqlProfileProvider"
            connectionStringName="LocalSqlServer"
            applicationName="/"
            type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
     </providers>
   </profile>

if you want to use the same name, add a <clear /> to the provider list.

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> Thanks again but i still get an error.
> I tried this:
[quoted text clipped - 60 lines]
>>>>> type="System.Web.Security.SqlMembershipProvider, System.Web,
>>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Mich - 31 Jan 2008 10:42 GMT
You gave me the solution:
in your second reply, you told me:
"it is not System.Web.ProfileProvider
it is
AspNetSqlProfileProvider"

well, in fact, it is:

System.Web.Profile.SqlProfileProvider

Thanks anyway

> simply copy and modify the provider section from your machine.config (in
> \windows\microsoft.net\framework\version\config
[quoted text clipped - 83 lines]
>>>>>> type="System.Web.Security.SqlMembershipProvider, System.Web,
>>>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.