c# - 无法登录到 Azure 网站,但在本地服务器上正常
问题描述
初始化字符串的格式不符合从索引 116 开始的规范。
连接字符串是:-
connectionString="Server=tcp:*******.database.windows.net,1433;Initial Catalog=*******;Persist Security Info=True;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;User ID=bill;Password="**************"" providerName="System.Data.SqlClient"
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[ArgumentException:初始化字符串的格式不符合从索引 116 开始的规范。]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +6047798
系统.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +127
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +100
System. Data.SqlClient.SqlConnectionString..ctor(字符串连接字符串)+61
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +29
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +169
System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) +63
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +93 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__18(DbConnection t, DbConnectionPropertyInterceptionContext1 c) +12 System.Data.Entity.Infrastructure.Interception.InternalDispatcher
1.Dispatch(TTarget target, Action2 operation, TInterceptionContext interceptionContext, Action
3执行, Action3 executed) +72 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(DbConnection connection, DbConnectionPropertyInterceptionContext
1拦截上下文)+360
System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +269
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(字符串名称,AppConfig 配置) +32
System.Data.Entity.Internal.LazyInternalConnection.Initialize() +129
System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName() +13 System.Data.Entity.Internal.LazyInternalContext.get_ProviderName() +11 System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext 上下文) +92
系统.Data.Entity.Internal.LazyInternalContext.InitializeContext() +515 System.Data.Entity.Internal.InternalContext.Initialize() +20 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +16
System.Data.Entity.Internal.Linq.InternalSet1.Initialize() +53 System.Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext() +15 System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider() +38 System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable
1 源,表达式1 predicate, CancellationToken cancellationToken) +138 System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable
1 源,表达式1 predicate) +145 Microsoft.AspNet.Identity.EntityFramework.<GetUserAggregateAsync>d__67.MoveNext() +402 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +102 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +64 Microsoft.AspNet.Identity.CultureAwaiter
1.GetResult() +59 Microsoft.AspNet.Identity.Owin。 d__24.MoveNext() +309 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) +102
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) +64 Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func1 func) +160 Microsoft.AspNet.Identity.Owin.SignInManagerExtensions.PasswordSignIn(SignInManager
2 manager , String userName, String password, Boolean isPersistent, Boolean shouldLockout) +127 Unisports.Account.Login.LogIn(Object sender, EventArgs e) in E:\Unisports\Unisports\Unisports\Account\Login.aspx.cs:37
系统。 Web.UI.WebControls.Button.OnClick(EventArgs e) +9794234
System.Web.UI.WebControls.Button.RaisePostBackEvent(字符串 eventArgument)+211
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(字符串 eventArgument)+12
System.Web.UI.Page。 RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.d__523.MoveNext() +5951
解决方案
经过 4 天的挫折后,我从 azure 中删除了整个项目和 Web 应用程序服务并重新安装它,它工作正常。
推荐阅读
- python - 将向量转换为非欧几里得空间,例如庞加莱空间
- sql - Oracle sql 使用 AM 将 char 格式转换为日期(to_date)
- c - CS:APP Malloc Lab - 为什么我的代码应该只执行一次却重复了 12 次?
- groovy - 这两个 groovy 调用如何相同?
- python - Python - 如何创建值出现的运行列表并计算第一个和最后一个之间的时间差?
- c# - 复制后删除文件会杀死应用程序
- ios - 如何快速延迟数组中的语音
- php - 如何使 PHP 服务器 websocket 在域上工作?
- tensorflow - TPU 在带有 Kubernetes 集群的 Google Cloud 上返回“对 cuInit 的调用失败:未知错误 (303)”
- javascript - 更新数组中组件的 Props