error when creating profile with modified provider

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
Mich [ Mi, 30 Januar 2008 20:17 ] [ ID #1919960 ]

Re: error when creating profile with modified provider

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"
Dominick Baier [ Mi, 30 Januar 2008 20:23 ] [ ID #1919961 ]

Re: error when creating profile with modified provider

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"




"Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com> schreef in
bericht news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
> 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 [ Mi, 30 Januar 2008 21:04 ] [ ID #1919969 ]

Re: error when creating profile with modified provider

This might help:
http://weblogs.asp.net/bradleyb/archive/2006/05/08/445727.as px

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


"Mich" wrote:

> 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"
>
>
>
>
> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com> schreef in
> bericht news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
> > 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"
> >
> >
>
>
>
pbromberg [ Mi, 30 Januar 2008 21:41 ] [ ID #1919978 ]

Re: error when creating profile with modified provider

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.

"Peter Bromberg [C# MVP]" <pbromberg [at] yahoo.NoSpamMaam.com> schreef in
bericht news:18853B5A-685E-47A7-AFAD-3306A21D7F9E [at] microsoft.com...
> This might help:
> http://weblogs.asp.net/bradleyb/archive/2006/05/08/445727.as px
>
> -- Pete
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> MetaFinder: http://www.blogmetafinder.com
>
>
> "Mich" wrote:
>
>> 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"
>>
>>
>>
>>
>> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com> schreef
>> in
>> bericht news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
>> > 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 [ Mi, 30 Januar 2008 22:45 ] [ ID #1919988 ]

Re: error when creating profile with modified provider

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)
> <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"
>
> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
> schreef in bericht
> news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
>
>> 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"
Dominick Baier [ Do, 31 Januar 2008 07:11 ] [ ID #1920686 ]

Re: error when creating profile with modified provider

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'.




"Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com> schreef in
bericht news:8e6a913a1bbe68ca31ef95eb0c10 [at] news.microsoft.com...
> 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)
>> <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"
>>
>> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
>> schreef in bericht
>> news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
>>
>>> 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 [ Do, 31 Januar 2008 09:01 ] [ ID #1920689 ]

Re: error when creating profile with modified provider

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:
> <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'.
> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
> schreef in bericht
> news:8e6a913a1bbe68ca31ef95eb0c10 [at] news.microsoft.com...
>
>> 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)
>>> <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"
>>> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
>>> schreef in bericht
>>> news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
>>>
>>>> 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"
Dominick Baier [ Do, 31 Januar 2008 09:51 ] [ ID #1920690 ]

Re: error when creating profile with modified provider

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


"Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com> schreef in
bericht news:8e6a913a1bbe98ca3205f20ab7f0 [at] news.microsoft.com...
> 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:
>> <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'.
>> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
>> schreef in bericht
>> news:8e6a913a1bbe68ca31ef95eb0c10 [at] news.microsoft.com...
>>
>>> 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)
>>>> <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"
>>>> "Dominick Baier" <dbaier [at] pleasepleasenospam_leastprivilege.com>
>>>> schreef in bericht
>>>> news:8e6a913a1bbb98ca319518f06d90 [at] news.microsoft.com...
>>>>
>>>>> 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 [ Do, 31 Januar 2008 11:42 ] [ ID #1920698 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » error when creating profile with modified provider

Vorheriges Thema: Oracle connectivity Issue with .Net
Nächstes Thema: Any quick solution to display performance diagnostics on every pag