【问题标题】:MVC3 project will not load dll properly aftering moving to win7 64-bit machineMVC3项目移至win7 64位机后无法正确加载dll
【发布时间】: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


    【解决方案1】:

    您是否在专用帐户下运行应用程序池?也就是说,网络服务以外的东西?如果是这样,您需要向 asp.net 临时文件目录添加权限。

    【讨论】:

    • 我并没有真正指定用cassini调试的应用程序池,但我会检查temp目录的权限。
    • 确保所有权限都在那里,而且它们确实在那里。我什至尝试了对临时 asp 文件和我的 bin 目录的完全权限,但仍然得到相同的异常。
    • 原来是隐藏在 web.config 中的模拟行,在本地运行不佳。
    猜你喜欢
    • 2014-11-17
    • 2019-10-09
    • 1970-01-01
    • 2012-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-20
    • 1970-01-01
    相关资源
    最近更新 更多