Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickOnce fails for BlazorWinFormsApp and BlazorWpfApp #31832

Closed
Jinjinov opened this issue Apr 15, 2021 · 16 comments
Closed

ClickOnce fails for BlazorWinFormsApp and BlazorWpfApp #31832

Jinjinov opened this issue Apr 15, 2021 · 16 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-desktop This issue is related to Blazor Desktop investigate
Milestone

Comments

@Jinjinov
Copy link

Jinjinov commented Apr 15, 2021

Describe the bug

BlazorWinFormsApp and BlazorWpfApp have
<Project Sdk="Microsoft.NET.Sdk.Razor"> and <TargetFramework>net6.0-windows</TargetFramework>

ClickOnce expects either
<Project Sdk="Microsoft.NET.Sdk.Razor"> and <TargetFramework>net6.0</TargetFramework>
or
<Project Sdk="Microsoft.NET.Sdk"> and <TargetFramework>net6.0-windows</TargetFramework>

To Reproduce

Using .NET 6 Preview 3 and VS 16.10.0 Preview 2

Exceptions (if any)

The item "C:\Users...\source\repos...\obj\Release\net6.0-windows\apphost.exe" in item list "ContentWithTargetPath" does not define a value for metadata "TargetPath". In order to use this metadata, either qualify it by specifying %(ContentWithTargetPath.TargetPath), or ensure that all items in this list define a value for this metadata.

Further technical details

  • ASP.NET Core version: 16.10.341.63941
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: Visual Studio 2019, Version 16.10.0 Preview 2.0
  • Include the output of dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.3.21202.5
 Commit:    aee38a6dd4

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5\

Host (useful for support):
  Version: 6.0.0-preview.3.21201.4
  Commit:  236cb21e3c

.NET SDKs installed:
  3.1.406 [C:\Program Files\dotnet\sdk]
  5.0.202 [C:\Program Files\dotnet\sdk]
  5.0.300-preview.21180.15 [C:\Program Files\dotnet\sdk]
  6.0.100-preview.3.21202.5 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
  Microsoft.AspNetCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
  Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
  Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
  Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
  Microsoft.AspNetCore.App 6.0.0-preview.3.21201.13 [C:\Program Files\dotnet\sha
red\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
  Microsoft.NETCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
  Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
  Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
  Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
  Microsoft.NETCore.App 6.0.0-preview.3.21201.4 [C:\Program Files\dotnet\shared\
Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.
WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.
WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.
WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.W
indowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.W
indowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-preview.3.21201.3 [C:\Program Files\dotnet\
shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-desktop This issue is related to Blazor Desktop labels Apr 15, 2021
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Apr 15, 2021
@ghost
Copy link

ghost commented Apr 15, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@TheCakeMonster
Copy link
Contributor

I think I've just run into this exception as well, while trying to use ClickOnce with a Mobile Blazor Bindings application. The exception shown in the build window in VS is as above, namely:

The item "C:\Users\Andrew\source\repos\DesiGen\src\UI\Windows\obj\Release\netcoreapp3.1\apphost.exe" in item list "ContentWithTargetPath" does not define a value for metadata "TargetPath". In order to use this metadata, either qualify it by specifying %(ContentWithTargetPath.TargetPath), or ensure that all items in this list define a value for this metadata.

I'm trying to use the publishing wizard to publish the Windows project that is created as part of the Hybrid Mobile Blazor Bindings template created by Eilon. My application targets .NET Core 3.1. I'm on VS 16.10 Preview 4, with the latest patches to .NET Core 3.1.

It looks like ClickOnce probably doesn't work for this scenario.

@Pilchie
Copy link
Member

Pilchie commented Jun 21, 2021

@NikolaMilosavljevic - any ideas here?

@NikolaMilosavljevic
Copy link
Member

@John-Hart is this a supported ClickOnce publishing scenario?

TheCakeMonster added a commit to TheCakeMonster/Examples that referenced this issue Jun 23, 2021
@TheCakeMonster
Copy link
Contributor

TheCakeMonster commented Jun 23, 2021

In order to try to narrow down the problem, I've created a new Hybrid Mobile Blazor Bindings app and attempted to publish that - and that also fails.

Repo can be found at https://github.com/TheCakeMonster/Examples/tree/master/Issues/BlazorHybridPublishFailure

Steps to reproduce:

  1. Install the Mobile Blazor Bindings template:
    dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview
  2. Create a new application using the template:
    dotnet new blazorhybrid -o BlazorHybridPublishFailure
  3. Publish the BlazorHybridPublishFailure.Windows project using the Visual Studio publishing wizard, using ClickOnce as the deployment method

@TheCakeMonster
Copy link
Contributor

For information, I've upgraded Visual Studio to Version 16.11.0 Preview 2.0, and the issue still occurs.

I've also manually installed SDK 5.0.204, which was previously missing from my machine. I think this is because I have, and I'm using 5.0.400-preview.21277.10 - which I think needed to be installed for Mobile Blazor Bindings to work, but exceeds the other runtime version numbers, so is perhaps overriding them.

The publish still fails. This may not be much of a surprise, as dotnet --info still reports 5.0.400-preview.21277.10

@John-Hart
Copy link

Sorry ClickOnce does not support Blazor templates. We should not be showing the ClickOnce publish provider for these projects.

@Pilchie
Copy link
Member

Pilchie commented Jun 23, 2021

@John-Hart these are new scenarios for hosting Blazor in a desktop app in .NET-6. ClickOnce support is a reasonable thing to expect.

@John-Hart
Copy link

@Pilchie thanks, we can look into adding it but right now it's not supported

@TheCakeMonster
Copy link
Contributor

@John-Hart Thanks for the feedback; it's very useful to understand the issue and get a feeling for the issue.

Do you think the solution something that a community developer might have a reasonable chance of delivering? I'm a pro developer, but MSBuild is not something I feel is a particular strength - .props and .targets are something I am aware of, but are still a bit of a mystery.

I'd appreciate your input on whether this is something I can offer to deliver to the community, as it's something I wanted to use. If you think there's a reasonable chance that I can do the work, then let me know if there is someone who can give me some pointers.

@John-Hart
Copy link

@TheCakeMonster, appreciate the offer. We need some time to look into this. Right now I don't know what changes are required to support these projects.

@TheCakeMonster
Copy link
Contributor

@John-Hart Understood, thanks.

@sujitnayak
Copy link

There are no current plans for ClickOnce to support Mobile Blazor Binding since it's not an officially released product.

Our current priority is to add ClickOnce publishing support to WPF/WinForms apps in the context of Blazor Desktop/WebView in the next Preview release of Visual Studio 2022.

@Eilon
Copy link
Member

Eilon commented Sep 1, 2021

Indeed, I believe we recently fixed everything that's needed for this: dotnet/maui#2187

The fix will be in the next preview of .NET 6.

@Eilon Eilon closed this as completed Sep 1, 2021
ASP.NET Core Blazor & MVC 6.0 automation moved this from 6.0-rc2 (CC: 14 Sep) to Done Sep 1, 2021
@Eilon Eilon modified the milestones: 6.0-rc2, 6.0-rc1 Sep 1, 2021
@Eilon Eilon added the Done This issue has been fixed label Sep 1, 2021
@TheCakeMonster
Copy link
Contributor

@Eilon thanks for the update, that's great news - and very good timing.

It appears that, suddenly, MBB no longer works on Windows. The deployment of the latest Edge Stable released Thursday 2nd/Friday 3rd Sept has broken it somehow. Anyone using it will need to move to .NET MAUI instead.

MicrosoftEdge/WebView2Feedback#1714

@Eilon
Copy link
Member

Eilon commented Sep 8, 2021

Oh yikes! I'll need to test this and see what's going on... maybe just updating to a newer WebView2 NuGet package might fix it somehow? I wonder if that works if you try it in your own project?

@ghost ghost locked as resolved and limited conversation to collaborators Oct 9, 2021
@mkArtakMSFT mkArtakMSFT added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Oct 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-desktop This issue is related to Blazor Desktop investigate
Projects
No open projects
Development

No branches or pull requests

10 participants