我正在测试一个网站,mvc 4 网站;我实际上正在学习MVC。
我已经将网站发布到我的个人主机上,在我的电脑上运行良好,但是一旦在我的主机上出现错误,这里首先是连接字符串:(我正在使用北风练习)
<add name="NorthwindEntities" connectionString="metadata=res://*/Models.NorthWindModel.csdl|res://*/Models.NorthWindModel.ssdl|res://*/Models.NorthWindModel.msl;
provider=System.Data.SqlClient;
provider connection string="
data source=**************.db.********.hostedresource.com;;
initial catalog=**********;
User ID=******;
MultipleActiveResultSets=True;
App=EntityFramework"
Password='********';
integrated security=True;"
providerName="System.Data.EntityClient" />
这是错误:
初始化字符串的格式不符合从索引 166 开始的规范。 说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.ArgumentException:初始化字符串的格式不符合从索引 166 开始的规范。
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[ArgumentException:初始化字符串的格式不符合从索引 166 开始的规范。] System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +5078242 System .Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +132 System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98 System. Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +118 System.Data.EntityClient.EntityConnection..ctor(String connectionString) +81 System.Data.Entity.Internal.LazyInternalConnection。InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)+78 System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(字符串名称,AppConfig 配置)+32 System.Data.Entity.Internal.LazyInternalConnection.Initialize()+131 System.Data.Entity.Internal。 LazyInternalConnection.CreateObjectContextFromConnectionModel() +13 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +281 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18 System.Data.Entity.Internal.Linq.InternalSetData.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +13 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +281 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18 System.Data.Entity .Internal.Linq.InternalSetData.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +13 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +281 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18 System.Data.Entity .Internal.Linq.InternalSet1.Initialize() +56
System.Data.Entity.Internal.Linq.InternalSet
1.GetEnumerator() +15 System.Data.Entity.Infrastructure.DbQuery 1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator() +40
System.Collections.Generic.List
1..ctor(IEnumerable 1 collection) +315
System.Linq.Enumerable.ToList(IEnumerable
1 源) +58 MvcApplication1.Controllers.HomeController.Index() +21 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase 控制器, Object[] 参数) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary 2 parameters) +188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 参数) +27 System.Web.Mvc.Async.<>c_ DisplayClass42.b _41() +28 System.Web.Mvc.Async.<>c_ DisplayClass8 1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +29 System.Web.Mvc。异步。<>c _DisplayClass39.b_ 33() +59 System.Web.Mvc.Async.<>C_DisplayClass4f.b_ 49() +240 System.Web.Mvc.Async.<>c _DisplayClass37.b_ 36(IAsyncResult asyncResult) +12 System.Web.Mvc.Async.WrappedAsyncResult 1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +31
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +23
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +128
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +50 System.Web.Mvc .Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26 System.Web.Mvc.<>c _DisplayClass1d.b_ 18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>c _DisplayClass4.b_ 3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult 1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController .EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>c _DisplayClass8.b_3(IAsyncResult asyncResult) +28 System.Web.Mvc.Async.<>c _DisplayClass4.b__3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc。 MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970061 系统.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
那么,世界到底发生了什么?我尝试了许多不同的连接字符串,但都没有成功。
谢谢