发布Azure Webapp - 编译错误

时间:2016-03-08 13:52:05

标签: azure azure-web-sites

我已将我的网站作为WebApp发布到Azure。如果我在浏览器中调用url,则会出现以下异常:

Compiler Error Message: The compiler failed with error code -532462766.

Details >> D:\Windows\system32>D:\home\site\wwwroot\bin\roslyn\csc.exe ..

Eventviewer提供了更多细节:

Event code: 3007
Event message: A compilation error has occurred.
Event time: 3/8/2016 1:35:14 PM
Event time (UTC): 3/8/2016 1:35:14 PM
Event ID: 477178e2e625406e9be094df085f6bc9
Event sequence: 3
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/540489099/ROOT-1-131019177071229326
Trust level: Full
Application Virtual Path: /
Application Path: D:\home\site\wwwroot\
Machine name: RD000D3AB25B42

Process information:
Process ID: 14752
Process name: w3wp.exe
Account name: IIS APPPOOL\mySite

Exception information:
Exception type: HttpCompileException
Exception message: External component has thrown an exception. at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) at System.Web.Compilation.BuildManager.CompileGlobalAsax() 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)


Request information:
Request URL: http://mySite.azurewebsites.net/
Request path: /
User host address: ...
User: 
Is authenticated: False
Authentication Type: 
Thread account name: IIS APPPOOL\mySite

Thread information:
Thread ID: 9
Thread account name: IIS APPPOOL\mySite
Is impersonating: False
Stack trace: at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) at System.Web.Compilation.BuildManager.CompileGlobalAsax() 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:

我试着

  • 重建项目并重新发布
  • 通过azure portal重新启动网站
  • 上下缩放网站以确保一个真正“新鲜”的状态

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

在设置>文件发布选项中选择删除目标上的其他文件。因为一些旧的dll可以阻止应用程序启动(版本问题等)。

答案 1 :(得分:0)

我遇到了这个问题,我设法解决了这个问题。首先,使用FTP客户端打开您的网站根目录并删除所有文件。接下来,在文件系统上发布您的项目,然后使用FTP客户端将其复制回网站根目录。