Hello,
I am using ASP.NET 2.0 with SQL 2005 to save the profile.
Suddenly, out of nothing I got the following error:
The 'System.Web.Profile.SqlProfileProvider' requires adatabase schema compatible with schema version '1'. However, thecurrent database schema is not compatible with this version. You mayneed to either install a compatible schema with aspnet_regsql.exe(available in the framework installation directory), or upgrade theprovider to a newer version.
Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.Exception Details:System.Configuration.Provider.ProviderException:The 'System.Web.Profile.SqlProfileProvider' requires a database schemacompatible with schema version '1'. However, the current databaseschema is not compatible with this version. You may need to eitherinstall a compatible schema with aspnet_regsql.exe (available in theframework installation directory), or upgrade the provider to a newerversion.
Source Error:
Line 22: Public Overridable Property Contacts() As PR.Contacts
Line 23: Get
Line 24: Return CType(Me.GetPropertyValue("Contacts"),PR.Contacts)
Line 25: End Get
Line 26: Set
I have no idea what is going on.
I already deleted all the databases and added a few more but nothing ... I used aspnet_regsql.exe from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe.
What should I do?
Thanks,
Miguel
You are missing the schema entry in the aspnet_schemaversions table for your database, if you moved the db from one server to another using scripts you still need to add the entries in this table.
Open this table and see if anything is missing. (profile,1,true) is what you need.
-c
Hello,
I didn't move the database. This is on my computer and I created the databases using aspnet_regsql.exe.
I opened ScemaVersions database and I have this:
What might be going wrong here?
I started to get this error out of nothing. I really have no idea what might be the cause of it.
Thanks,
Miguel
Can you post the profile config xml from your web.config - remember to hide passwords! ;)
Hi,
Where is my profile code in Web.Config:
<!-- Profile -->
<profile enabled="true" defaultProvider="ProfileProvider" automaticSaveEnabled="true">
<!-- Profile Providers -->
<providers>
<clear/>
<add applicationName="AppName" connectionStringName="MyDatabase" name="ProfileProvider" type="System.Web.Profile.SqlProfileProvider"/>
</providers>
<!-- Profile Properties -->
<properties>
<add allowAnonymous="false" name="Collaborator" type="MyWebSite.Collaborator" serializeAs="Binary"/>
<add allowAnonymous="false" name="Contacts" type="MyWebSite.Contacts" serializeAs="Binary"/>
<add allowAnonymous="false" name="Options" type="MyWebSite.Options" serializeAs="Binary"/>
<add allowAnonymous="false" name="Personal" type="MyWebSite.Personal" serializeAs="Binary"/>
<add allowAnonymous="true" name="Settings" type="MyWebSite.Settings" serializeAs="Binary"/>
</properties>
</profile>
Any idea what might be going on?
Thanks,
Miguel
Ok some more questions - I see you're using custom types with a binary serializer - why? and did you change the class definitions for any of these custom types? If so and there was stored profile data, this would break your system since the serializer wouldn't be able to de-serialize the objects.
-c
maybe just something to try - but if you did change your class definitions - try deleting all the data in the profile table, it should re-serialize and might fix it.
-c
Hi,
Should I use other type?
Here is a class as example:
' Collaborator
<Serializable()> _
Public Class Collaborator
' -- [Properties] --------------
' Comments
Private _Comments As String
Public Property Comments() As String
Get
Return _Comments
End Get
Set(ByVal value As String)
_Comments = value
End Set
End Property ' Comments
' CurriculumVitae
Private _CurriculumVitae As String
Public Property CurriculumVitae() As String
Get
Return _CurriculumVitae
End Get
Set(ByVal value As String)
_CurriculumVitae = value
End Set
End Property ' CurriculumVitae
...
And by the way, suddenly I stopped getting the error.
This was really strange.
Thanks,
Miguel
0 comments:
Post a Comment