Tôi không thể giải quyết vấn đề này:Khung thực thể: Ký tự không hợp lệ trong đường dẫn. (Chuỗi kết nối) (MVC3)
Tôi đang cố gắng sử dụng khung Entity trong dự án MVC3 của mình. Nhưng mỗi lần tôi gọi Entities context = new Entities();
Tôi nhận được lỗi này: Các ký tự không hợp lệ trong đường dẫn. Tôi biết điều này có cái gì để làm với connectionstring của tôi, mà là như sau:
metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=databasename;Persist Security Info=True;User ID=username;Password=password;MultipleActiveResultSets=True"
tôi đã sử dụng Reflector để tìm hiểu xem các nguồn lực nơi đúng nhúng trong lắp ráp của tôi, và câu trả lời là có họ được một cách hoàn hảo nhúng trong hội đồng của tôi dưới dạng Models.Model.csdl, .ssdl và .msl ...
Mô hình của tôi ở trong cùng một cụm như tôi đang cố gắng kết nối và KHÔNG được tham chiếu, có nghĩa là ký tự đại diện * nên chỉ làm việc tốt.
Các ConnectionString là chính xác giống như tạo ra bởi các thuật sĩ ...
[ArgumentException: Illegal characters in path.]
System.IO.Path.CheckInvalidPathChars(String path) +142
System.IO.Path.Combine(String path1, String path2) +46
System.Web.Compilation.DiskBuildResultCache.GetBuildResult(String cacheKey, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate) +41
System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate) +237
System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate) +162
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +91
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +203
System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) +180
System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath) +18
System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations) +228
System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations) +492
System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +198
System.Web.Mvc.<>c__DisplayClassc.<FindView>b__b(IViewEngine e) +47
System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths) +177
System.Web.Mvc.ViewResult.FindView(ControllerContext context) +144
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +151
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +784900
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371
Nó thậm chí không hiển thị ActionResult nơi mà vấn đề đang xảy ra ...
Thật không may, các ký tự không hợp lệ có thể có trong tên người dùng hoặc mật khẩu. Có lẽ bạn có thể đăng chúng tranh giành? Hoặc ít nhất là danh sách các loại ký tự trong đó? –
Vâng, tôi cũng nghĩ về điều đó, những nhân vật thực sự bình thường của họ. Không có gì đặc biệt, như "thisisapassword" ... soo [a-zA-Z] – reinder