error when creating profile with modified provider

  • Thread starter Thread starter Mich
  • Start date Start date
M

Mich

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
 
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)
 
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"
 
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.
 
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'.
 
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.
 
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
 
Back
Top