简体   繁体   中英

Cannot publish .net6.0 wpf application

I am trying to publish WPF app on .net6.0-windows platform that should be running on Win x64. App is buildable and is running on local, I can publish it in framework-dependant mode, but target PC does not have.Net6.0 so I need self-contained version.

I cannot create self-contained version. It always fails with generic pretty much useless message. 在此处输入图像描述

Inside file there is just useless error.

System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: 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 --- ---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---

Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.

===================

Only hint I have is build log:

1 of 10 projects are up-to-date for restore.
There was no runtime pack for Microsoft.WindowsDesktop.App.WPF available for the specified RuntimeIdentifier 'linux-x64'.
========== Build: 3 succeeded, 0 failed, 7 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

But I do not understand what is going on, I am trying to publish app under win x64, not linux.

在此处输入图像描述

App is using .net6.0-windows framework and multiple .net6.0 libraries.

Ensure you have the correct nuget source, as it tries to pull .net runtime compilers from a nuget source and not from your local machine in order to publish the self-contained solution: Nuget ORG Public URL: https://api.nuget.org/v3/index.json Add a nuget source: https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM