Dotnet Core 2.0 Web App发布到Azure失败

时间:2018-05-04 16:13:06

标签: azure visual-studio-2017 asp.net-core-2.0

来自VS 2017 我尝试了什么:

  1. 构建发布模式&调试模式都很好。
  2. 将Build verbosity设置为Diagnostic,没有太多信息 表示代码错误。
  3. 然而.tmp转储文件表示有些错误。 我怀疑这些是视觉工作室的内部错误:

    5/4/2018 9:34:44 PM
    System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
       at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
       at System.Threading.Tasks.Task`1.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
    ---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---
    
    ===================
    

2 个答案:

答案 0 :(得分:1)

RazorCompileOnBuild属性设置为true应该可以解决您的问题。

看看下面的question

答案 1 :(得分:0)

不得不在诊断中设置构建详细程度,然后发现在未使用的Razor视图页面中存在一些错误。

必须有一种方法可以在构建期间而不是在发布时编译Razor。