【发布时间】:2011-06-10 17:31:56
【问题描述】:
IT 最近将我从 Win xp 32 位机器转移到 Win 7 Enterprise 64 位机器。在安装 VS2010、MVC3 和其他各种组件后,我提取了我正在处理的 MVC3 项目的最新版本。当我运行调试器时,我得到了黄屏死机,它引用了我的解决方案中另一个项目的 dll,并带有以下错误代码:
无法加载文件或程序集“Core”或其依赖项之一。访问被拒绝。 说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
还有堆栈跟踪:
[FileLoadException:无法加载文件或程序集“核心”或其依赖项之一。访问被拒绝。]
[FileLoadException:无法加载文件或程序集'Core,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'或其依赖项之一。访问被拒绝。] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,StackCrawlMark 和 stackMark,Boolean for Introspection,Boolean suppressSecurityChecks)+132 System.Reflection.RuntimeAssembly.InternalLoad(字符串 assemblyString,证据 assemblySecurity,StackCrawlMark 和 stackMark,Boolean for Introspection)+144 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException:无法加载文件或程序集“Core,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”或其依赖项之一。访问被拒绝。] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): 无法加载文件或程序集'Core,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'或其依赖项之一。访问被拒绝。] System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文) +8972240 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext 上下文)+97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
它在另一台机器上运行良好,并且将在服务器上正常加载。是否有任何安全问题或我忽略了什么,我是 win7 64 位环境的新手?或者还有什么我忘记说明的对你们来说很明显的事情?
编辑:我也尝试过 IIS Express 7.5,最终结果相同。
EDIT2:我现在解决了这个问题,方法是在本地调试时禁用 web.config 文件中的模拟,并将该行添加到发布转换以在服务器上部署。
【问题讨论】:
标签: visual-studio-2010 windows-7 64-bit asp.net-mvc-3