Closed Jinjinov closed 3 years ago
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.
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.
@NikolaMilosavljevic - any ideas here?
@John-Hart is this a supported ClickOnce publishing scenario?
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:
dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview
dotnet new blazorhybrid -o BlazorHybridPublishFailure
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
Sorry ClickOnce does not support Blazor templates. We should not be showing the ClickOnce publish provider for these projects.
@John-Hart these are new scenarios for hosting Blazor in a desktop app in .NET-6. ClickOnce support is a reasonable thing to expect.
@Pilchie thanks, we can look into adding it but right now it's not supported
@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.
@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.
@John-Hart Understood, thanks.
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.
Indeed, I believe we recently fixed everything that's needed for this: https://github.com/dotnet/maui/pull/2187
The fix will be in the next preview of .NET 6.
@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.
https://github.com/MicrosoftEdge/WebView2Feedback/issues/1714
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?
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
16.10.341.63941
Visual Studio 2019, Version 16.10.0 Preview 2.0
dotnet --info