ASP.NET MVC 4, The “WebSecurity.InitializeDatabaseConnection” method can be called only once

后端 未结 5 1617
迷失自我
迷失自我 2020-12-19 07:00

I am developing a code first web app in Visual Studio 2012 Express.

I use this connection string in the web.config:



        
5条回答
  •  时光取名叫无心
    2020-12-19 07:49

    If it is already initialized then make sure your first call:

    if (!WebSecurity.Initialized)
    {
        // Do the initialization first.
    }
    
    // The rest of the code
    

    This way you'll be sure that you don't repeat the initialization process.

提交回复
热议问题