我正在使用C# (.NET Framework 4)中的ASP.NET开发网站。在创建新网站项目后,我尝试运行该项目。但是我遇到了以下错误:
无法加载文件或程序集“file:///C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files \ myfirst \ 159977c5 \ b9e740fc \ App_global.asax.yfqtni9g.dll”或其某个依赖项。系统找不到指定的文件。
我已经阅读了下面的链接(所有内容都涉及访问文件夹),但它们没有帮助我 :(
https://dev59.com/BmPVa4cB1Zd3GeqP7JYS https://dev59.com/43RA5IYBdhLWcg3w6SRH http://web.archive.org/web/20101023213019/http://www.yetanotherdeveloper.com/post/2008/08/10/Could-not-load-file-or-assembly-App_Web.aspx我检查并为“Temporary ASP.NET Files”及其子文件夹和文件的Users用户组提供了完全访问权限。
程序集加载跟踪
WRN:程序集绑定记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)设置为1。
注意:启用程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog]。
堆栈跟踪
[FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\4ff7194b\2da62764\App_global.asax.h-eem9xt.dll' or one of its dependencies. The system cannot find the file specified.]
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, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +28
System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +93
System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +60
System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +9118863
System.Web.Compilation.BuildManager.CompileGlobalAsax() +44
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +265
[HttpException (0x80004005): Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\4ff7194b\2da62764\App_global.asax.h-eem9xt.dll' or one of its dependencies. The system cannot find the file specified.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +421
System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +691
[HttpException (0x80004005): Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\4ff7194b\2da62764\App_global.asax.h-eem9xt.dll' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
如果这是一个重复的问题,请给我一个链接
感谢您的帮助。
以下是我的日志
操作成功完成。
绑定结果:hr = 0x0。操作成功完成。
程序集管理器从此处加载:C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
在可执行文件 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe 下运行。
---以下详细错误日志。
=== 预绑定状态信息 ===
LOG: 用户=John-PC\John
LOG: 显示名称=Microsoft.VisualStudio.ComponentModelHost,Version=10.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a(完全指定)
LOG: Appbase=file:///G:/WorkShop/HTML-CSS/ASP/MyFirst/
LOG: 初始 PrivatePath=G:\WorkShop\HTML-CSS\ASP\MyFirst\bin
LOG: 动态基址=C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\159977c5
LOG: 缓存基址=C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\159977c5
LOG: AppName=b9e740fc
调用程序集:(未知)。
===
LOG:此绑定在默认加载上下文中开始。
LOG:使用应用程序配置文件:G:\WorkShop\HTML-CSS\ASP\MyFirst\web.config
LOG:使用主机配置文件:
LOG:使用位于 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的机器配置文件。
LOG: 通过在 GAC 中查找来找到程序集。
LOG: 绑定成功。从 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.ComponentModelHost\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.ComponentModelHost.dll 返回程序集。
LOG: 程序集加载在默认加载上下文中。
我无法追踪到任何错误。请帮忙...