error when creating profile with modified provider

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
 
D

Dominick Baier

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)
 
M

Mich

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"
 
M

Mich

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

Mich

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

Dominick Baier

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

Mich

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top