2011-01-19 25 views
5

Bu sorunun çözüldüğünü alamıyorum:Varlık Çerçevesi: Yoldaki geçersiz karakterler. (Bağlantı Dizesi) (MVC3)

MVC3 projemdeki Entity Framework'ü kullanmaya çalışıyorum. Ancak, her defasında Entities context = new Entities(); numaralı telefonu arıyorum. Bu hatayı alıyorum: Yoldaki geçersiz karakterler. şöyle Bunu anlarım benim connectionstring ile bir ilgisi vardır:

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" 

düzgün benim montaj gömülü kaynaklar olmadığını öğrenmek için yansıtıcı kullanılan ve cevap evet onlar mükemmel gömülü olduğu

Benim derlemem Modeller.Model.csdl, .ssdl ve .msl ...

Modelim, bağlanmaya çalıştığım ile aynı derlemede ve başvurulan NOT'tur, yani joker * olması gerektiği anlamına gelir sadece iyi çalış. Hatta sorun oluştuğunu ActionResult göstermiyor

[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 

sihirbazı tarafından oluşturulan olarak ConnectionString tamamen aynıdır

... ... Nihayet

+0

Ne yazık ki, geçersiz karakterler kullanıcı adı veya parolada olabilir. Belki onları şifreli gönderebilirsin? Ya da en azından onların içindeki karakter türlerini listeleyebilir mi? –

+0

Eh, ben de, onların aslında sadece normal karakterleri düşündüm. "Thisisapassword" gibi özel bir şey yok ... soo [a-zA-Z] – reinder

cevap

1

, çıkardıktan sonra SERVERNAME \ INSTANCE'ta ters eğik çizgi çalışmaya başladı. (SQL Server Örneğimde bir ters eğik çizgi olmadan bir takma ad ekledi). Muhtemelen web.config kullanarak yasadışı karakterlerin ters eğik çizgi kaldırılarak da çözülebilir ... bu listede ne kadar var? Bilinmiyor