0

community! I experience an issue with custom profile in ASP.NET MVC application. I defined the following custom provider as follows:

<profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="App.Business.AccountProfile">
  <providers>
    <clear/>
    <add
      name="AspNetSqlProfileProvider"
      connectionStringName="DefaultConnection"
      applicationName="/"
      type="System.Web.Profile.SqlProfileProvider" />
  </providers>
</profile>

My class for this profile:

    public class AccountProfile : ProfileBase
    {
        static public AccountProfile CurrentUser
        {
            get
            {
                return (AccountProfile)
                       (ProfileBase.Create(HttpContext.Current.User.Identity.Name));
            }
        }

        public string SomeProp
        {
            get { return (string)base["SomeProp"]; }
            set { base["SomeProp"] = value; Save(); }
        }
    }

But when I try to access this new property by invoking this code:

AccountProfile.CurrentUser.SomeProp

I get the following error:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

I checked the connection string and it's working. What can be the cause of my issue?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Dmitry Korolev
  • 675
  • 4
  • 20
  • have you setup the database to have all the asp.net goodies? – Daniel A. White Mar 06 '16 at 12:38
  • @DanielA.White I am using sql express, entity framework and code-first approach. So, the database was created automatically. Waht should I shange in the setup? – Dmitry Korolev Mar 06 '16 at 13:13
  • 2
    Possible duplicate of [Could not find stored procedure 'dbo.aspnet\_CheckSchemaVersion'](http://stackoverflow.com/questions/2165908/could-not-find-stored-procedure-dbo-aspnet-checkschemaversion) – davmos Mar 06 '16 at 19:31

0 Answers0