2009-06-10 133 views
0

昨天我将我的网站从c:\ development \ project \部署到c:\ inetpub \ wwwroot \ virtualdir \(同一个pc)。它工作了一段时间,我可以通过http://computername/virtualdir/访问该网站。.NET MVC - 系统无法找到指定的路径

但今天早上,每个人都有一个错误:系统找不到指定的路径。

无法找到指定的路径是什么?/virtualdir/bin /包含System.Web.Mvc.Dll程序集...另外,部署项目已将其标记为依赖项,因此我在安装过程中确实包含了它,它如何突然更改?

堆栈跟踪:

[DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)]

[FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the path specified.]

[FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the path specified.] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the path specified.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildManager.GetReferencedAssemblies() +55 System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetReferencedAssemblies() +21 System.Web.Mvc.ControllerTypeCache.GetAllControllerTypes(IBuildManager buildManager) +62 System.Web.Mvc.ControllerTypeCache.EnsureInitialized(IBuildManager buildManager) +73 System.Web.Mvc.DefaultControllerFactory.GetControllerTypeWithinNamespaces(String controllerName, HashSet`1 namespaces) +83 System.Web.Mvc.DefaultControllerFactory.GetControllerType(String controllerName) +305 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +65 System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +128 System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57 System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

回答

1

它找到一个System.Web.Mvc就好了,因为你可以在堆栈跟踪看到:

System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +128 

什么似乎正在发生的事情是ControllerTypeCache,当试图列举所有引用以查找控制器的assmeblies时,无法找到被另一个引用的程序集。

阅读blog entry关于如何确切地确定缺少的内容。

+0

感谢您的信息! – Ropstah 2009-06-10 08:46:57

0

对于通过搜索来到此问题的其他人,可能会导致该错误消息的另一个配置错误是,如果您的虚拟目录配置中没有为“asnet_isapi.dll”创建的通配符映射。

要创建映射:

  • 打开虚拟目录的属性。
  • 在“虚拟目录”选项卡,单击“配置”按钮
  • 点击“插入”,并浏览到相应的.NET版本的“ASPNET_ISAPI.DLL”文件
  • 取消选中“验证文件是否存在”复选框
相关问题