【发布时间】:2020-04-08 23:36:49
【问题描述】:
我正在尝试使用针对 win-x86 的发布单个文件发布针对 .NET Core 3.1 的 WPF 应用程序(到文件夹)。应用程序可以正常发布调试,但发布失败。如果我取消选择“生成单个文件”,则发布工作正常。我正在使用 Visual Studio 2019(16.4.1 和预览版 16.5.1)
我在发布时收到此一般错误:
发布遇到错误。发布遇到错误。我们 无法确定错误的原因。检查输出日志 更多细节。
诊断日志已写入以下位置: "C:\Users\用户名\AppData\Local\Temp\tmpD176.tmp"
加上一个不太有用的日志文件:
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log 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.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>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.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.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.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__156.MoveNext()
---> (Inner Exception #0) System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---
System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
我发现 this question 表明这可能是 Visual Studio 超时的问题,尽管该问题与 Azure 有关。我还发现了这个Github issue,当我尝试使用ReadyToRun 发布时,它显示出类似的情况。
我们在几周前成功发布了,改动很小。这可能是 Visual Studio 的问题吗?我意识到这可能是引用和 NuGet 包的问题,但我真的不知道从哪里开始了解这个问题的核心......发布没有提供任何有关可能导致问题的有用信息.有什么想法吗?
【问题讨论】:
-
您是否尝试使用
dotnetCLI 从命令行发布它? -
@mm8 谢谢,这有助于提供更多信息,但仍然没有解决问题。我怀疑问题可能出在 Visual Studio 上。
标签: c# wpf visual-studio .net-core .net-core-3.1