【发布时间】:2020-03-09 15:31:35
【问题描述】:
我有一个简单的工作者应用程序(使用工作者服务模板),它只是帮助我将 .net 核心项目迁移到在 linux 上运行的测试。 我的问题是,当我引用 log4Net 的 nuget 包时,我在尝试发布时遇到错误。
目标位置:本地 HD 上的文件 配置:发布 目标框架:netcoreapp3.1 目标运行时:linux-x64
"Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. "
查看临时目录中的日志显示
"3/9/2020 11:09:39 AM
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__213.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.
===================
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>dotnet-UnbuntuWorker-7195FC82-40A3-4F0A-A32C-29EA1B03EA6E</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<Content Update="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="LogConfig\" />
</ItemGroup>
</Project>
感谢您的帮助
【问题讨论】:
-
您能否在您的
csproj文件中显示相关部分? (log4net等版本) -
当然..将其添加到原始问题中。谢谢
-
更新这显然发生在我针对除“便携式”之外的任何运行时