program tip

저장 프로 시저 'dbo.aspnet_CheckSchemaVersion'을 찾을 수 없습니다.

radiobox 2020. 9. 18. 08:01
반응형

저장 프로 시저 'dbo.aspnet_CheckSchemaVersion'을 찾을 수 없습니다.


내 사이트를 호스팅하기 위해 WinHost.com을 사용하고 있습니다. SQL 데이터베이스 / 멤버십 시스템은 내 로컬 컴퓨터에서 완벽하게 작동하지만 서버에 업로드하면 작동하지 않습니다. 모든 단계를 올바르게 따랐습니다. 내 서비스에 대해 지원팀에 연락했지만 2 주가 지났고 응답이 없습니다.

내 사이트의 멤버십 페이지에서 로그인하거나 새 사용자를 등록하려고 할 때이 오류가 계속 발생합니다.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +378
   System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +89
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
   System.Web.UI.WebControls.Login.AttemptLogin() +115
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016 

누군가가이 오류가 발생한 이유 (분명히 뭔가를 찾을 수 없습니다 ...), 어떻게 고칠 수 있는지 알려주시겠습니까?

다들 감사 해요

Bael


aspnet_regsql.exeWinHost.com의 SQL 서버에 대해 실행 했습니까 ?

aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName

위의 명령을 어디에서 실행해야할지 모르는 경우 'aspnet_regsql.exe'실행 파일을 실행하면됩니다.

In order to locate this file open your RUN Command Box by pressing Windows Key + r and put below command in that %windir%\Microsoft.NET\Framework\v4.0.30319 and Hit enter then find 'aspnet_regsql.exe' file. It will open a wizard that you can follow to resolve this error.

This error mostly occurs when you didn't enabled Roles in your asp.net mvc project At starting before aspnet identity table automatically created.

You will need to make sure you run this so that the tables and objects are created on WinHost.com's SQL server.


Open visual studio command prompt from the Visual studio tools folder from the start menu and type aspnet_regsql

and follow the wizard to register the database for asp.net membership and role providers.


I've seen this before. The database you are using doesn't have the required database elements for the membership, role management and profile features. So you've got a couple of options:

  1. Copy across the tables, stored procedures & views from your local SQL Server using SQL Management Studio or a similar application
  2. Use the aspnet_regsql.exe tool to install the scripts from anew as per the instructions in this post (I don't believe you can use the tool against a remote database if it's locked down. So you'll have to export the scripts and run them manually)

I have the same problem- i copy/paste connectionString from SQL Object manager in Visual Studio and forget to type Initial Catalog=YourDatabaseName.


Check the schema the stored procedure belongs to on your host - it could be that it's not in the "dbo" schema.

e.g. if it's within SomeOtherSchema, your call would need to be "SomeOtherSchema.aspnet_CheckSchemaVersion"


I had the exact same error when I had enabled <roleManager> believing I was enabling ASP.NET Identity 2. They are not the same! The <roleManager> enabled an old version of identity management which uses a different table structure to ASP.NET Identity 2 (which doesn't need "enabling" by the way - it's just there).

If you are intentionally using the old role-manager and still getting the error you might be looking at the default localdb instead of your database, in which case you can modify <roleManager> to point at any connection string you want:

  <roleManager
      enabled="true"
      cacheRolesInCookie="true"
      defaultProvider="OurSqlRoleProvider"
     >
      <providers>
          <add
             connectionStringName="DefaultConnection"
             applicationName="/"
             name="OurSqlRoleProvider"
             type="System.Web.Security.SqlRoleProvider" />
      </providers>

  </roleManager>

If you are are after using ASP.NET Identity 2, here's an article on it:
http://johnatten.com/2014/04/20/asp-net-mvc-and-identity-2-0-understanding-the-basics/


In short you should recompile the aspnet provider dll using the sql username you were assigned from your hosting.

  • Download the http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi
  • Replace from the source code all the references to dbo with your hosting database username
  • Compile (you need Visual Studio) and place the ProviderToolkitSampleProviders.dll in the Bin folder
  • In your web.config replace the "type" attribute of every line with “Microsoft.Samples., ProviderToolkitSampleProviders”
  • Replace in you local sql server all dbo references with your hosting database username
  • Export the sql object creation script and run them on the remote database
  • Copy the records from your local sql table aspnet_SchemaVersions to the remote database

Another option, pheraps simpler to try, is to replace the dbo references in your local sql server database with your hosting database username, then upload and attach your mdf file.

Hope it helps

Thomas

참고URL : https://stackoverflow.com/questions/2165908/could-not-find-stored-procedure-dbo-aspnet-checkschemaversion

반응형