Redth / dotnet-maui-check

.NET MAUI Check tool
MIT License
479 stars 79 forks source link

Fails to install Microsoft.Maui.Templates #16

Closed CRidge closed 3 years ago

CRidge commented 3 years ago

I'm trying to follow the guide found here to play around with Maui.

The first time I run the maui-check tool, it installed a few things, but I couldn't get my example to run. So I tried running the tool again, and it said "Microsoft.Maui.Templates" was missing and it tried to re-install it, but it doesn't seem to be able to. It doesn't log what goes wrong, it just doesn't find it on the next run. I don't find it in my packs folder either.

The output from a run (maui-check -dnf) is:

` _
| \ | | | ____| |
| | \/ | / \ | | | | | |
| | | |
| | | | |\/| | / \ | | | | | |
| |\ | | |__ | | | | | | /
\ | || | | |
(
) || _| |____| || || || // _\ ___/ |___|

¤ .NET MAUI Check ¤ ──────────────────────────────────────────────────────────────────────────────── This tool will attempt to evaluate your .NET MAUI development environment. If problems are detected, this tool may offer the option to try and fix them for you, or suggest a way to fix them yourself.

Thanks for choosing .NET MAUI! ──────────────────────────────────────────────────────────────────────────────── » Synchronizing configuration... ok » Scheduling appointments... ok

OpenJDK 1.8.0-1 Checkup...

  • 1.8.0-25 (C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\bin..)

Visual Studio 16.9.0 Checkup...

  • 16.10.0-pre.1.0 - C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview
  • 16.8.4

Android SDK Checkup...

  • emulator (30.5.4)
  • build-tools;30.0.2 (30.0.2)
  • platforms;android-30 (3)
  • system-images;android-30;google_apis;x86 (9)
  • platform-tools (31.0.1)

Android Emulator Checkup...

  • Emulator: Android_Accelerated_x86_Oreo found.

.NET SDK Checkup...

  • 2.1.201 - C:\Program Files\dotnet\sdk\2.1.201
  • 2.1.202 - C:\Program Files\dotnet\sdk\2.1.202
  • 2.1.300-preview1-008174 - C:\Program Files\dotnet\sdk\2.1.300-preview1-008174
  • 2.1.301 - C:\Program Files\dotnet\sdk\2.1.301
  • 2.1.400 - C:\Program Files\dotnet\sdk\2.1.400
  • 2.1.401 - C:\Program Files\dotnet\sdk\2.1.401
  • 2.1.402 - C:\Program Files\dotnet\sdk\2.1.402
  • 2.1.403 - C:\Program Files\dotnet\sdk\2.1.403
  • 2.1.523 - C:\Program Files\dotnet\sdk\2.1.523
  • 2.1.600-preview-009472 - C:\Program Files\dotnet\sdk\2.1.600-preview-009472
  • 2.1.600 - C:\Program Files\dotnet\sdk\2.1.600
  • 2.1.601 - C:\Program Files\dotnet\sdk\2.1.601
  • 2.1.617 - C:\Program Files\dotnet\sdk\2.1.617
  • 2.1.700 - C:\Program Files\dotnet\sdk\2.1.700
  • 2.1.800-preview-009677 - C:\Program Files\dotnet\sdk\2.1.800-preview-009677
  • 2.1.815 - C:\Program Files\dotnet\sdk\2.1.815
  • 2.2.101 - C:\Program Files\dotnet\sdk\2.2.101
  • 2.2.104 - C:\Program Files\dotnet\sdk\2.2.104
  • 2.2.107 - C:\Program Files\dotnet\sdk\2.2.107
  • 2.2.108 - C:\Program Files\dotnet\sdk\2.2.108
  • 2.2.200-preview-009648 - C:\Program Files\dotnet\sdk\2.2.200-preview-009648
  • 2.2.200-preview-009748 - C:\Program Files\dotnet\sdk\2.2.200-preview-009748
  • 2.2.200 - C:\Program Files\dotnet\sdk\2.2.200
  • 2.2.201 - C:\Program Files\dotnet\sdk\2.2.201
  • 2.2.202 - C:\Program Files\dotnet\sdk\2.2.202
  • 2.2.300 - C:\Program Files\dotnet\sdk\2.2.300
  • 2.2.400-preview-010195 - C:\Program Files\dotnet\sdk\2.2.400-preview-010195
  • 2.2.401 - C:\Program Files\dotnet\sdk\2.2.401
  • 3.0.100 - C:\Program Files\dotnet\sdk\3.0.100
  • 3.1.113 - C:\Program Files\dotnet\sdk\3.1.113
  • 3.1.201 - C:\Program Files\dotnet\sdk\3.1.201
  • 3.1.300 - C:\Program Files\dotnet\sdk\3.1.300
  • 5.0.102 - C:\Program Files\dotnet\sdk\5.0.102
  • 5.0.104 - C:\Program Files\dotnet\sdk\5.0.104
  • 5.0.200-preview.21077.7 - C:\Program Files\dotnet\sdk\5.0.200-preview.21077.7
  • 6.0.100-preview.3.21202.5 - C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5

.NET SDK - EnableWorkloadResolver.sentinel Checkup...

  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdk Resolver\EnableWorkloadResolver.sentinel exists.
  • C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5\EnableWorkloadResolver.sentinel exists.

.NET SDK - Workloads (6.0.100-preview.3.21202.5) Checkup...

  • microsoft-android-sdk-full (Microsoft.NET.Workload.Android : 11.0.200-preview.3.196) installed.
  • microsoft-ios-sdk-full (Microsoft.NET.Workload.iOS : 14.4.100-preview.3.1326) installed.
  • microsoft-maccatalyst-sdk-full (Microsoft.NET.Workload.MacCatalyst : 14.3.100-preview.3.471) installed.
  • microsoft-tvos-sdk-full (Microsoft.NET.Workload.tvOS : 14.3.100-preview.3.1379) installed.
  • microsoft-macos-sdk-full (Microsoft.NET.Workload.macOS : 11.1.100-preview.3.1379) installed.

.NET SDK - Packs (6.0.100-preview.3.21202.5) Checkup... ¡ Microsoft.Maui.Templates (6.0.100-preview.3.322) not installed.

  • Microsoft.iOS.Windows.Sdk (14.4.100-preview.3.1326) installed.
  • Microsoft.Android.Sdk (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Sdk.BundleTool (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Ref (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Templates (11.0.200-preview.3.196) installed.
  • Microsoft.iOS.Sdk (14.4.100-preview.3.1326) installed.
  • Microsoft.iOS.Ref (14.4.100-preview.3.1326) installed.
  • Microsoft.iOS.Templates (14.4.100-preview.3.1326) installed.
  • Microsoft.MacCatalyst.Sdk (14.3.100-preview.3.471) installed.
  • Microsoft.MacCatalyst.Ref (14.3.100-preview.3.471) installed.
  • Microsoft.MacCatalyst.Templates (14.3.100-preview.3.471) installed.
  • Microsoft.tvOS.Sdk (14.3.100-preview.3.1379) installed.
  • Microsoft.tvOS.Ref (14.3.100-preview.3.1379) installed.
  • Microsoft.tvOS.Templates (14.3.100-preview.3.1379) installed.
  • Microsoft.macOS.Sdk (11.1.100-preview.3.1379) installed.
  • Microsoft.macOS.Ref (11.1.100-preview.3.1379) installed.
  • Microsoft.macOS.Templates (11.1.100-preview.3.1379) installed.

──────────────────────────────────────────────────────────────────────────────── ¤ Recommendation: Install Missing SDK Packs ────────────────────────────────────────────────────────────────────────────────

» Attempting to fix: .NET SDK - Packs (6.0.100-preview.3.21202.5) Installing Pack: Microsoft.Maui.Templates... Installed Pack: Microsoft.Maui.Templates. Fix applied. Checking again...

.NET SDK - Packs (6.0.100-preview.3.21202.5) Checkup... ¡ Microsoft.Maui.Templates (6.0.100-preview.3.322) not installed.

  • Microsoft.iOS.Windows.Sdk (14.4.100-preview.3.1326) installed.
  • Microsoft.Android.Sdk (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Sdk.BundleTool (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Ref (11.0.200-preview.3.196) installed.
  • Microsoft.Android.Templates (11.0.200-preview.3.196) installed.
  • Microsoft.iOS.Sdk (14.4.100-preview.3.1326) installed.
  • Microsoft.iOS.Ref (14.4.100-preview.3.1326) installed.
  • Microsoft.iOS.Templates (14.4.100-preview.3.1326) installed.
  • Microsoft.MacCatalyst.Sdk (14.3.100-preview.3.471) installed.
  • Microsoft.MacCatalyst.Ref (14.3.100-preview.3.471) installed.
  • Microsoft.MacCatalyst.Templates (14.3.100-preview.3.471) installed.
  • Microsoft.tvOS.Sdk (14.3.100-preview.3.1379) installed.
  • Microsoft.tvOS.Ref (14.3.100-preview.3.1379) installed.
  • Microsoft.tvOS.Templates (14.3.100-preview.3.1379) installed.
  • Microsoft.macOS.Sdk (11.1.100-preview.3.1379) installed.
  • Microsoft.macOS.Ref (11.1.100-preview.3.1379) installed.
  • Microsoft.macOS.Templates (11.1.100-preview.3.1379) installed.

──────────────────────────────────────────────────────────────────────────────── ¤ Recommendation: Install Missing SDK Packs ────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────

! There were one or more problems detected. Please review the errors and correct them and run maui-check again. `

I've tried the --verbose flag without getting any more information about why it fails. Installation of the pack obviously fails somehow - how can I find out what went wrong?

Redth commented 3 years ago

Thanks, I've got a repro of this as well and an idea to fix it. Unfortunately there's a few places the template can end up and I'm not checking one of them.

deaquino commented 3 years ago

I'm facing the same issue:

` Recommendation: Install Missing SDK Packs ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

! Attempt to fix? [y/n] (y): y » Attempting to fix: .NET SDK - Packs (6.0.100-preview.4.21215.1) Installing Pack: Microsoft.Maui.Templates... The following template packages will be installed: C:\Users\XXXX\AppData\Local\Temp\Microsoft.Maui.Templates.6.0.100-preview.3.322.nupkg

Object reference not set to an instance of an object. at Microsoft.TemplateEngine.Cli.TemplatePackageCoordinator.EnterInstallFlowAsync(INewCommandInput commandInput, CancellationToken cancellationToken) in Microsoft.TemplateEngine.Cli.dll:token 0x600018b+0x2f6 at Microsoft.TemplateEngine.Cli.New3Command.ExecuteAsync() in Microsoft.TemplateEngine.Cli.dll:token 0x6000148+0x381 at Microsoft.TemplateEngine.Cli.CommandParsing.NewCommandInputCli.<>c__DisplayClass102_0.<b__0>d.MoveNext() in Microsoft.TemplateEngine.Cli.dll:token 0x60004b5+0x71 Failed to install Pack: Microsoft.Maui.Templates. Fix applied. Checking again...

.NET SDK - Packs (6.0.100-preview.4.21215.1) Checkup... Looking for pack: Microsoft.Maui.Templates (6.0.100-preview.3.322) Looking for template pack on disk: C:\Program Files\dotnet\template-packs Newest dotnet sdk version to look for templates in: C:\Users\jaime.aquino.templateengine\dotnetcli\v6.0.100-preview.4.21215.1\packages ¡ Microsoft.Maui.Templates (6.0.100-preview.3.322) not installed.`

deaquino commented 3 years ago

@Redth The latest commits you've done related to the manifest fixes the issue. I'm facing another one, the system don't find Microsoft.Maun package, but I haven't investigate it yet. I'll take a look.

Cheers

gurasaa commented 3 years ago

image Installing loop again , how to review the errors?

Depechie commented 3 years ago

I got the same error

⏳ Attempting to fix: .NET SDK - Packs (6.0.100-preview.4.21255.9)
  Installing Pack: Microsoft.Maui.Templates...
/bin/zsh -c 'sudo rm -rf "/var/folders/58/dt3f4lyx2ds7mwjqn_7639r00000gn/T/tmpSn7loo.tmp"'
/bin/zsh -c 'sudo mkdir -p "/var/folders/58/dt3f4lyx2ds7mwjqn_7639r00000gn/T" && sudo cp -pP "/var/folders/58/dt3f4lyx2ds7mwjqn_7639r00000gn/T/tmpSn7loo.tmp" "/var/folders/58/dt3f4lyx2ds7mwjqn_7639r00000gn/T/Microsoft.Maui.Templates.6.0.100-preview.4.634.nupkg"'
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. A device attached to the system is not functioning.
 (0x8007001F)
File name: 'Microsoft.Extensions.DependencyModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Microsoft.DotNet.Cli.Utils.FrameworkDependencyFile..ctor()
   at Microsoft.DotNet.Tools.New.NewCommandShim.CreateHost(Boolean disableSdkTemplates) in dotnet.dll:token 0x60002f5+0xd6
   at Microsoft.DotNet.Tools.New.NewCommandShim.Run(String[] args) in dotnet.dll:token 0x60002f4+0x77
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8
   at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f
  Failed to install Pack: Microsoft.Maui.Templates.
System.Exception: Failed to install Pack: Microsoft.Maui.Templates.

Update With adding --dev it works!

ThatRendle commented 3 years ago

I got this too, with .NET 6 Preview 5, had to manually dotnet new -i Microsoft.Maui.Templates

Redth commented 3 years ago

Fixed in newer versions/previews.