我目前有一个 Asp.net 站点,它的所有提供商都使用 MySQL 数据库。我使用默认的 asp.net web 表单模板作为测试平台,登录有效,注册有效,但是当我尝试管理我的新帐户时,我收到此错误
表 'trotski.usersopenauthaccounts' 不存在
当它试图调用这个函数时
Dim accounts = OpenAuth.GetAccountsForUser(User.Identity.Name)
(整个错误日志:)
表 'trotski.usersopenauthaccounts' 不存在 说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。 异常详细信息:MySql.Data.MySqlClient.MySqlException:表 'trotski.usersopenauthaccounts' 不存在 源错误: 第 68 行: 第 69 行:公共函数 GetExternalLogins() As IEnumerable(Of OpenAuthAccountData) 第 70 行:昏暗帐户 = OpenAuth.GetAccountsForUser(User.Identity.Name) 第 71 行:CanRemoveExternalLogins = CanRemoveExternalLogins OrElse accounts.Count() > 1 第 72 行:返回帐户 源文件:C:\Users\dev1\Documents\Visual Studio 2012\Projects\MySite\MySite\Account\Manage.aspx.vb 行:70 堆栈跟踪: [MySqlException (0x80004005): 表 'trotski.usersopenauthaccounts' 不存在] MySql.Data.MySqlClient.MySqlStream.ReadPacket() +383 MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& 影响行,Int64& 插入 ID)+116 MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) +54 MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +145 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1258 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior 行为)+2523 MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior 行为)+58 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior 行为)+10 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior 行为)+437 [EntityCommandExecutionException:执行命令定义时发生错误。有关详细信息,请参阅内部异常。] System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior 行为)+507 System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +730 System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +131 System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator() +36 System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator() +126 System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator() +99 System.Collections.Generic.List`1..ctor(IEnumerable`1 集合)+369 System.Linq.Enumerable.ToList(IEnumerable`1 源) +58 Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.GetAccountsForUser(字符串成员资格用户名)+2838 Microsoft.AspNet.Membership.OpenAuth.OpenAuthManager.GetAccountsForUser(字符串成员用户名)+127 Microsoft.AspNet.Membership.OpenAuth.OpenAuth.GetAccountsForUser(String membersUserName) +59 C:\Users\dev1\Documents\Visual Studio 2012\Projects\MySite\MySite\Account\Manage.aspx.vb:70 中的 MySite.Manage.GetExternalLogins() [TargetInvocationException:调用的目标已引发异常。] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(对象 obj,对象 [] 参数,对象 [] 参数)+192 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] 参数, CultureInfo 文化) +108 System.Reflection.MethodBase.Invoke(Object obj, Object[] 参数) +19 lambda_method(闭包,MethodInfo,对象,对象[])+46 System.Web.UI.WebControls.ModelDataSourceView.InvokeMethod(ModelDataSourceMethod 方法) +207 System.Web.UI.WebControls.ModelDataSourceView.GetSelectMethodResult(DataSourceSelectArguments 参数)+74 System.Web.UI.WebControls.ModelDataSourceView.ExecuteSelect(DataSourceSelectArguments 参数)+14 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 参数,DataSourceViewSelectCallback 回调)+21 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138 System.Web.UI.WebControls.ListView.PerformSelect() +167 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +105 System.Web.UI.WebControls.ListView.CreateChildControls() +122 System.Web.UI.Control.EnsureChildControls() +83 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint)+974