c# - 编译错误 - 编译器失败,错误代码为 1

标签 c# asp.net-mvc iis iis-8

我最近在部署到我们的共享主机时遇到了问题。从 Visual Studio 通过 Web 部署进行部署时,99% 的情况下我都会在登录后在登录页面或主页上收到此错误。有时我可能会在不同的部分点击几次,然后它就会出现。它通常会在几分钟到 90 分钟后消失。

运行 Windows Server 2012 R2 Standard、IIS8、.NET 4.5 的虚拟主机。

网络主机建议我需要使用 Visual Studio 中的 x86 构建配置。我已经在任何 Cpu、x86、x64 中尝试了许多不同的调试/发布配置,并且都产生了相同的结果。

我们现在已经在主机上尝试了三个不同的服务器,基本上每次发布后都可以成功重现错误。我们刚刚尝试了一个全新的环境,经过三次部署,bam '编译器失败,错误代码为 1'。

他们反驳说这不是他们的问题,没有其他客户端受到影响,这一定与我的配置或设置有关。我在去年的开发过程中将同一个站点部署到我的本地 IIS,但从未见过这个问题。我什至今天启动了一个 Azure 帐户并更改和部署了我的站点 20 次并且无法复制。此外,我在 VS 中创建了一个全新的项目,没有进行任何更改并部署到主机,并设法在完全普通/标准的 VS Web 项目中解决了完全相同的错误。

我不知道该何去何从 - 我们在预付款方面已向该主机投入了大量资金,现在他们在这个问题上完全阻挠我们。

这是我在浏览器中运行时遇到的错误;

C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Web.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\Microsoft.Web.Infrastructure.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\App_global.asax.0fxbfjfx.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\592e2a3b\29b1fed4_a9a7d001\Newtonsoft.Json.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\566cae42\db53a6d1_a9a7d001\DotNetOpenAuth.OpenId.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\21e1b328\b7f2d4d1_a9a7d001\Elmah.Mvc.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\a19ebce4\b3bb1b1a_4bb0d001\AuthProviders.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\14784cab\ac3152d1_a9a7d001\DotNetOpenAuth.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\6c4b1e36\af6893f2_24b0d001\Antlr3.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\55a46179\d9526fd2_a9a7d001\Hangfire.SqlServer.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\98ce0055\5bcefc1a_4bb0d001\ResearchAdmin.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\bd297971\a10a43d2_a9a7d001\EntityFramework.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\409fa562\f13f12d3_a9a7d001\System.Web.Mvc.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\fbaa1837\26a344d3_a9a7d001\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\963201db\699517d5_a9a7d001\Owin.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\099eba28\818699d5_a9a7d001\StructureMap.Net4.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\7dc6fd96\007f4b16_be7cce01\Microsoft.Web.WebPages.OAuth.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\5b5c7757\1d9b01d3_a9a7d001\Microsoft.AspNet.Identity.EntityFramework.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\036a8b7a\d72127d1_a9a7d001\DDay.iCal.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\cbef3179\f9acd5f3_24b0d001\System.Web.Optimization.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\abc23773\e9e056d4_a9a7d001\System.Net.Http.Primitives.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\dd2023f8\097a25d5_a9a7d001\Postal.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\ae279640\e33e65d2_a9a7d001\Hangfire.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\2891a974\ff0961d3_a9a7d001\WebMatrix.WebData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\d3e20003\2b39f7d2_a9a7d001\Microsoft.AspNet.Identity.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\47d1ca6b\05e37ed4_a9a7d001\Microsoft.Owin.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\a09629f2\d1be4ad3_a9a7d001\System.Web.WebPages.Razor.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\41ee05b3\b8e332d1_a9a7d001\DotNetOpenAuth.AspNet.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\c4b2bc24\b20645d2_a9a7d001\EntityFramework.SqlServer.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\af441148\1a1547d3_a9a7d001\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\45fcd364\26f073d1_a9a7d001\DotNetOpenAuth.OAuth.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\9489863a\4d62a9d1_a9a7d001\Mono.Math.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\51030571\a80fabd1_a9a7d001\Org.Mentalis.Security.Cryptography.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\2ffb59b1\f28421d3_a9a7d001\System.Web.Razor.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\224a3832\a10539d5_a9a7d001\RazorEngine.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\c5bf8794\519dacd5_a9a7d001\WebActivatorEx.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\e20826ff\441149d3_a9a7d001\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\2f66de0b\ed3255d4_a9a7d001\System.Net.Http.Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\606d1e4b\3bd978d5_a9a7d001\RestSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\b6635993\e5678bd4_a9a7d001\Microsoft.Owin.Host.SystemWeb.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\2252966f\d059441a_4bb0d001\AuthProviders.EF.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\420b90fc\c16062d1_a9a7d001\DotNetOpenAuth.OAuth.Consumer.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\a4d97c70\53fbbfd1_a9a7d001\DotNetOpenAuth.OpenId.RelyingParty.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\7a7ef0a7\bc13ced1_a9a7d001\Elmah.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\1d666353\4f3899d5_a9a7d001\StructureMap.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\4132b786\56e455d3_a9a7d001\WebMatrix.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\assembly\dl3\8eaf4a45\6877f1f3_24b0d001\WebGrease.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\App_Web_indexvendor.cshtml.a8d08dba.w0o4an61.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror- "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\App_Web_indexvendor.cshtml.a8d08dba.w0o4an61.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b101b654\d371881d\App_Web_indexvendor.cshtml.a8d08dba.w0o4an61.1.cs"



与此同时,ELMAH 正在记录这些方面的错误,我相信这两者是相关的;

System.Web.HttpCompileException (0x80004005): External component has thrown an exception. at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetCompiledType(String virtualPath) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

最佳答案

回收然后停止和启动应用程序池拯救了我的一天。

关于c# - 编译错误 - 编译器失败,错误代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31081651/

相关文章:

c# - 什么是线程安全 (C#)? (字符串,数组,...?)

c# - 重新设计 Windows 窗体应用程序中的标准工具栏的样式(仅限 C#)

c# - Paypal 沙箱无法识别新返回的 ProfileID(错误 11546)

javascript - JavaScriptSerializer 期间 ASP.NET MVC AngularJS 中的 MaxJsonLength 异常

asp.net - IIS 负载平衡和 ASP.Net

c# - 图像不保留缩放比例和偏移

c# - MVC4如何知道变量的类型

javascript - 间歇性发布两次..使用IE

iis - 在 IIS 下使用 SSL 的多个子域

asp.net - 我的 system.webServer > staticContent > clientCache 元素阻碍了 CSS、JavaScript 和图像的服务