Open damien-c-d opened 3 years ago
I tested my .Net5 WPF project with steps which you provided, but I can't reproduce your error and I can published it succeeded. My OS Version is 19042.630 and Visual Studio version is 16.8.3. My published steps refer to Publish a single file app - Visual Studio.Could you show me your project which published failed for me to analyze?
I tested my .Net5 WPF project with steps which you provided, but I can't reproduce your error and I can published it ucceeded. My OS Version is 19042.630 and Visual Studio version is 16.8.3. My published steps refer to Publish a single file app - Visual Studio.Could you show me your project which published failed for me to analyze?
I can't share the original project I experienced this issue in. But here is one I created 5 minutes ago on a PC that had a fresh install of windows and VS over the weekend and was able to repro the issue.
I get the below error when attempting to publish your above TestApplication. If I set SelfContained
to false
, though, it succeeds.
1>The "GenerateBundle" task failed unexpectedly.
1>System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath
1> at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
1> at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore()
1> at Microsoft.NET.Build.Tasks.TaskBase.Execute()
1> at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1> at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
I guess ClickOnce is not as functional in .NET 5.0 as it was said to be. If I change the project back to target .NET 3.1 then it publishes successfully self-contained.
Does .Net 5 ClickOnce support Self-Contained apps?
According to https://devblogs.microsoft.com/dotnet/announcing-net-5-0/,
The primary deployment model we’re currently supporting is framework dependent apps. It is easy to take a dependency on the .NET Desktop Runtime (that’s the one that contains WPF and Windows Forms). Your ClickOnce installer will install the .NET runtime on user machines if it is needed. We also intend to support self-contained and single file apps.
I tried installing a .Net 5 Self-contained Clickonce application on a clean Windows 7 SP2 machine (.net 5 not installed). I disabled the prerequisite from downloading/bundling in the published folder. I get an error ("...The application requires your system to be updated to Microsoft Common Language Runtime 4.0xxxx") when i run the ClickOnce installer. I believe one of the problems Self-Contained apps is supposed to solve is requiring users to install .Net, especially when they do not have admin privileges. It's not working for me.
Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
Problem description: Publishing Self Contained Single File WPF Application in .NET 5.0 fails after adding references/nuget packages.
Actual behavior:
Output Window Text: OutputWindowText.txt
Log File From Error Window: tmp6214.tmp.txt
Expected behavior: Publish Succeeded
Minimal repro: