当我尝试在 IIS 7.5 上启动 ASP.net 站点时,出现以下错误
BC2000: compiler initialization failed unexpectedly: 0x80070005
环顾四周,我找到了一个可能的解决方案:转到 C:\Windows\Temp 文件夹的安全设置,并为用户“NETWORK SERVICE”和 IIS_IUSRS 添加完全控制权限。
但我这样做了,错误还在继续。
在我的机器中 %temp% 指向 C:\Users\sp\AppData\Local\Temp ,它也具有这些权限。
我还尝试使用实用程序“aspnet_regiis”重新安装 ASP。
这是完整的事件日志条目(应用程序警告 1310):
Event code: 3007
Event message: A compilation error has occurred.
Event ID: 733bee25fcbe4f0ab74b7fc56ce833d7
Event sequence: 3
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/5/ROOT-1-129798160562503533
Trust level: Full
Application Virtual Path: /
Process information:
Process ID: 8040
Process name: w3wp.exe
Account name: IIS APPPOOL\myapp
Exception information:
Exception type: HttpCompileException
Exception message: vbc : Fatal (0): error BC2000: compiler initialization failed unexpectedly: 0x80070005
Request information:
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: sp-PC\sp
Thread information:
Thread ID: 8
Thread account name: sp-PC\sp
Is impersonating: False
Stack trace: at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)
at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)
at System.Web.Compilation.BuildManager.CompileCodeDirectories()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
所以我所做的工作是将应用程序池的用户更改为机器管理员(IIS 管理器 > 应用程序池 > 高级设置 > 身份)。但这似乎不太安全。
所以我的问题是:为什么它不能使用“内置帐户”(我尝试了 ApplicationPoolIdentity 和 NetworkService)。