VS dotnet core 控制台应用程序无法发布

VS dotnet core 控制台应用程序无法发布

我正在尝试使用 Visual Studio 2017 社区版发布一个 dotnet core 自包含控制台应用程序。

当我进入只需单击发布的步骤时,一切似乎都正常,大约 10-15 秒,然后弹出一个窗口,显示以下失败消息。

Publish has encountered an error.
Publishing failed.

A diagnostic log has been written to the following location:
.....AppData\Local\Temp\tmp343.tmp

然后我转到该文件,这是消息......

System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
   --- 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.ApplicationCapabilities.Publish.Model.DefaultPublishSteps.<>c__DisplayClass22_0.<IsBuildCompletedSuccessfully>b__1()
   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.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__19.MoveNext()
--- 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__127.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---

通常我不会请别人帮我查看日志,但日志并没有告诉我太多信息。我想知道是否有其他人遇到过类似的问题,并且他们能够解决它。

另外,有人可能会问,我可以成功构建和运行该应用程序。我之前已经部署过它。我最近对应用程序做了一些更改,但没有什么重大变化。为了确保万无一失,我甚至将分支切换到已知的可发布应用程序并尝试发布该版本。同样的问题。我认为这与 VS 有关。有什么想法吗?

相关内容