question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Unable to run either maui or maui blazor templates from the command line

See original GitHub issue

Description

I am unable to run the WinUI version of these templates from Visual Studio due to other errors. I am also unable to run it on the command line.

Steps to Reproduce

  1. dotnet new maui-blazor -n MauiBlazor
  2. dotnet run MauiBlzor.WinUI -t:Run -f net6.0-windows10.0.19041
  3. Observe the following:
C:\Data\Git\_username\MauiBlzor\MauiBlzor.WinUI>dotnet run MauiBlzor.WinUI -t:Run -f net6.0-windows10.0.19041
The launch profile "(Default)" could not be applied.
A usable launch profile could not be located.
C:\Users\R\.nuget\packages\microsoft.projectreunion.winui\0.8.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(167,18): error MSB4086: A numeric comparison was attempted on "$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentVersion)" that evaluates to "" instead of a number, in condition "'$(AppxUseResourceIndexerApi)' == '' AND '$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentVersion)' < '6.3'". [C:\Data\Git\_username\MauiBlzor\MauiBlzor.WinUI\MauiBlzor.WinUI.csproj]

The build failed. Fix the build errors and run again.

Expected Behavior

No idea but not this, presumably some window opens or something, angels sing and … you fill in the rest.

Actual Behavior

It displays the above error message.

Basic Information

  • Version with issue: 6.0.100-preview.7.21379.14? This is a fresh first install of MAUI via the new VS2022 preview.
  • Last known good version: Never tried before
  • IDE: Command line.
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages: None
  • Affected Devices: Windows 10 computer.

Screenshots

Not a visual issue.

Reproduction Link

Above in the listed steps.

Workaround

No workaround. There are similar errors elsewhere but none of the solutions are things that apply here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Tealonscommented, Jan 13, 2022

Oh, wow. This will indeed be crucial when launching a MAUI to production. Doing this without our CI/CD flow is a no-go…

1reaction
Daniellledcommented, Oct 1, 2021

I hope this gets fixed soon. Our CICD pipeline is command line only. So that means we can only build and test locally in VS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot known issues - .NET MAUI
NET MAUI either through Visual Studio, or by installing your chosen .NET SDK version and running the dotnet workload install maui command.
Read more >
Creating new .NET 6 MAUI project
To search for the templates on NuGet.org, run 'dotnet new maui --search'. So why can't I use this command? c# · maui .net-6.0....
Read more >
Sharing Code with Blazor & .NET MAUI
Shared Blazor components can power UI across web & native apps, thanks to .NET MAUI.
Read more >
Blazor Hybrid Web Apps with .NET MAUI
MAUI provides a set of technologies that enable apps to run on Web, desktop, and mobile. ... MAUI will be available from Visual...
Read more >
Is Maui dead on arrival? : r/dotnet
Since I want to be able to develop something for multiple platforms including webassembly, MAUI + Blazor seems to be the only option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found