今天更新系统上传到阿里云服务器,报错以下:web
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中致使错误的出处的详细信息。
异常详细信息: System.ComponentModel.Win32Exception: 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。
源错误:
服务器
执行当前 Web 请求期间生成了未经处理的异常。能够使用下面的异常堆栈跟踪信息肯定有关异常缘由和发生位置的信息。 |
堆栈跟踪:
app
[Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。] [ExternalException (0x80004005): 没法执行程序。所执行的命令为 "f:\usr\LocalUser\qxw2309550136\bin\roslyn\csc.exe" /shared /keepalive:"10" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8726d835\c1ae0133\lx3hbi43.cmdline"。] System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +6487183 System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +115 System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName) +59 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile(CompilerParameters options, String compilerFullPath, String arguments, String& outputFile, Int32& nativeReturnValue) +193 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +680 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186 System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +23 System.Web.Compilation.AssemblyBuilder.Compile() +884 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +9520058 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +9950660 System.Web.Compilation.BuildManager.CompileGlobalAsax() +44 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +269 [HttpException (0x80004005): 没法执行程序。所执行的命令为 "f:\usr\LocalUser\qxw2309550136\bin\roslyn\csc.exe" /shared /keepalive:"10" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8726d835\c1ae0133\lx3hbi43.cmdline"。] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +427 System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +535 [HttpException (0x80004005): 没法执行程序。所执行的命令为 "f:\usr\LocalUser\qxw2309550136\bin\roslyn\csc.exe" /shared /keepalive:"10" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8726d835\c1ae0133\lx3hbi43.cmdline"。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9952212 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254 |
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34280ide
这个错误在本地测试是没有的。工具
我所使用的开发工具是vs2015。开发工具
当我发布到阿里云虚拟主机时报的错。测试
通过百度没有找到解决方案,又用bing终于在stackoverflow上找到了解决方案。解决方案以下:ui
意思就是打开nuget,而后卸载Microsoft.CodeDom.Providers.DotNetCompilerPlatform 包,从新编译发布。阿里云
详细参考:https://stackoverflow.com/questions/35184429/problems-publishing-a-website-on-smarterasp-net-with-csc-exe-file-included/35207055#35207055spa
我是经过这种方式解决的。