- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我在 SO 中的第一个问题,如果我有语法错误,请向我道歉。
问题描述:
我在 IIS 7 (Windows Server 2008) 和 SQL Server 2008 R2 上安装了基于 32 位 MVC 5 的 CRUD 系统,并安装在多台服务器上,自 2015 年 8 月起提供公司内网管理服务。几个月来,所有这些都顺利运行,没有任何问题。然而,昨天我发现我无法访问 172.16.1.101 服务器上的站点根页面,并显示以下消息:
> Server Error in '/' Application.
> [Win32Exception (0x80004005): Access is denied]
>[ExternalException (0x80004005): Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\-(random 8-digit hex)-\-(random 8-digit hex)-\-(random 8-char base64).cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +3365
System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +8591876
Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs) +331
Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +784
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +170
System.Web.Compilation.AssemblyBuilder.Compile() +12440424
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +303
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +12978145
System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +665
>[HttpException (0x80004005): Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\-(random 8-digit hex)-\-(random 8-digit hex)-\-(random 8-char base64)-.cmdline".]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +80
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1142
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1193
>[HttpException (0x80004005): Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\-(random 8-digit hex)-\-(random 8-digit hex)-\-(random 8-char base64)-.cmdline".]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12980692
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12820285
这是发生异常时的事件日志:
>IIS 7 Event Log
>Event code: 3005
>Event message: An unhandled exception has occurred.
>Event time: 5/24/2016 1:42:08 PM
>Event time (UTC): 5/24/2016 6:42:08 AM
>Event ID: 062751a2dc724be9af5de99014e58a47
>Event sequence: 2
>Event occurrence: 1
>Event detail code: 0
>Application information:
>Application domain: /LM/W3SVC/3/ROOT-1-131085457263004464
>Trust level: Full
>Application Virtual Path: /
>Application Path: E:\Test\
>Machine name: -- edited --
>Process information:
>Process ID: 1172
>Process name: w3wp.exe
>Account name: IIS APPPOOL\ASP.NET v4.0
>Exception information:
>Exception type: HttpException
>Exception message: Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\-(random 8-digit hex)-\-(random 8-digit hex)-\-(random 8-char base64)-.cmdline".
at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
>Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\-(random 8-digit hex)-\-(random 8-digit hex)-\-(random 8-char base64).cmdline".
at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
at Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames)
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.<PerformBuild>b__1(AssemblyBuilder assemblyBuilder)
at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
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.CompileResourcesDirectory()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
>Access is denied
>Request information:
>Request URL: //172.16.1.101/
>Request path: /
>User host address: //172.16.1.101
>User:
>Is authenticated: False
>Authentication Type:
>Thread account name: IIS APPPOOL\ASP.NET v4.0
>Thread information:
>Thread ID: 5
>Thread account name: IIS APPPOOL\ASP.NET v4.0
>Is impersonating: True
>Stack trace: at >System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
>Custom event details:
有时消息会显示\Temporary ASP.NET Files\tls 目录,而不是\Temporary ASP.NET Files\root 目录。
IIS 7 服务器配置为默认状态和单个池,默认情况下没有任何运行的 Web 服务(仅基本配置),包括 XML(反)序列化器。
最初以为我的IIS系统账户权限错误,我已经设置权限为“完全控制”但没有成功。
因此,根据消息预期服务器端缺少文件编译,尝试通过此命令在CMD上手动编译cmdline文件
csc.exe /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root-(random 8-digit hex)--(random 8-digit hex)--(random 8-char base64).cmdline"
提供错误:
fatal error CS2021: File name '@C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root-(random 8-digit hex)--(random 8-digit hex)--(random 8-char base64).cmdline' is too long or invalid
error CS2011: Error opening response file 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\root-(random 8-digit hex)--(random 8-digit hex)--(random 8-char base64).cmdline' -- 'The system cannot find the file specified. '
不会放弃,我对这个问题进行了谷歌搜索,并在 SO 上找到了相关的类似问题:
Problems publishing a website on smarterasp.net with csc.exe file included?
但是,在为实时服务器实现编译项目时,我既没有安装“Microsoft.CodeDom.Providers.DotNetCompilerPlatform”包也没有使用 SOAP,并且已经在 web.config 上设置了“identity impersonate="true"”属性但无济于事.
接下来,我使用“高级设置”选项配置了与站点对应的 IIS 应用程序池,将身份部分从“ApplicationPoolIdentity”更改为“LocalSystem”,有趣的是,访问根页面时的 YSOD 消失了。我试图在“ApplicationPoolIdentity”上将其改回原来的状态,但 YSOD 返回了。
即使问题已经通过 LocalSystem 身份暂时解决了,我仍然好奇为什么在没有任何系统故障迹象的情况下发生错误。我想在这里问 2 个问题:
谁能解释为什么 ApplicationPoolIdentity 选项在这种情况下不起作用?
我可以采取哪些步骤来缓解其他服务器的此问题,即使它们的默认设置和 ApplicationPoolIdentity 已设置?
tl;dr:在 IIS 7 服务器上使用默认配置的 ApplicationPoolIdentity 一直工作到昨天我在既没有应用 XML 序列化器也没有应用 Web 服务的服务器上遇到了上述 YSOD,请帮助我解释或描述服务器上已经发生的详细问题以及缓解方法。
PS:所写目录路径中的“-”和“--”符号应替换为“\”。
最佳答案
从 nuget 包中卸载 DotNetCompilerPlatform
关于c# - IIS 7 错误 : Cannot execute a program. 正在执行的命令是 csc.exe(ApplicationPoolIdentity 默认设置),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37427195/
我为我的一些问题设置了标签。当搜索 labels="ab"时,我得到了相关的标签,但我似乎找不到询问标签的正确语法!="ab"。如何查询不等于ab的? 最佳答案 != 对我有用,尽管它只显示带有标签的
我最近使用 Visual Studio 2013 Express 配置了 GITHUB 和 Demo GITHub 帐户,即用于练习目的。 Good News is that : I have con
我有一个用于播放和暂停的切换按钮。 这是代码: export default (props) => { let [soundState, setSoundState] = useState({ s
一个 XML 文件被发布到我的 spring mvc 正在响应的 URL。 在 .NET 中,我可以这样做: request.Form[0] request.Form["abc"] 或 request
我们的监控脚本遇到问题。 程序流程为 客户将文件(.csv 格式)ftp/sftp 到“源”目录 Bash 脚本将完成的 .csv 文件重命名为 .aaa 文件 另一个 Bash 脚本将“.aaa”文
如果我开始一个线程: new Thread(() -> { while (running) { try { Thread.sl
我正在制作一个看起来像真正的书的 PDF 阅读器。 我在 ScrollView 中有一个 UIImageView 作为书的背景(想象一本打开的书,有空页)。 UIImageView 的层有 2 个子层
创建 Accordion - 在幻灯片上 - 正在滑动的元素下方的元素似乎向下移动了 px,然后又向上移动,从而产生了颤动效果。 $(document).ready(function() { //Pr
我有一个非常奇怪的问题,但只有在运行 Ubuntu 时才会出现(在 CentOS 上一切正常)。我用 Perl 编写了一个脚本并使用了 Mail::IMAPClient模块。 当我运行以下命令时: p
我知道我可以检查 UITextView 是否正在使用 textViewDidBeginEditing: 进行编辑,但我想检查它是否正在使用 if 语句进行编辑? 最佳答案 使用方法isFirstRes
我正在制作一个简单的点击器类型的游戏。问题是,我的 JPanel 忽略了我设置为每秒更新的 Swing 计时器,而是每毫秒更新一次,即使我删除了计时器也是如此。除了计时器的监听器之外,不会在任何地方调
我有以下代码,应该通过组织列表对每个组织进行 td,对每个组织调用 toString 方法,并将结果打印到控制台和名为 Debug1.tab 的文件。 try { StreamWriter p
我有以下代码用于将文件从 url 下载到 sdcard 。此代码适用于小文件,但当文件大时,我下载的文件大小为 0。任何帮助将不胜感激。 Java 代码 setContentView(R.layout
我有一个必须使用 tomcat 部署的 Angular 项目。 Angular 文件在 dist/project-ui/ 中构建文件夹。我复制了 project-ui文件夹到 webapps tomc
我有一堆切换按钮,下面有标签。如果按钮的标签变得太长,那么下一行的第一个按钮将卡在该标签上。 这是我的代码: https://jsfiddle.net/Android272/c150305z/ 我查了
具有特殊字符的 InnerHTML 正在 trim 数据。 elem.innerHTML = displayedObjects.name; 这里的 displayedObjects.name 包含一个
我已经成功地设置了我的证书和 key ,并使用了在这里找到的 mysql 文档: http://dev.mysql.com/doc/refman/5.1/en/replication-solution
在为游戏制作动画和更新计时器时,我读到任何与 GUI 相关的 Activity 都应该在 EDT 上运行,包括重新绘制屏幕。我正在使用单个 ScheduledExecutorService 来更新和绘
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Large numbers erroneously rounded in Javascript 我正在使用
我已经为 .NET RyuJit 安装了新的 Jit 编译器,并按照安装文档中的说明在 regedit 的 .NetFramework 中设置了 AltJit=* 键。 http://blogs.ms
我是一名优秀的程序员,十分优秀!