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

"Getting started" MAUI App does not run on Windows #3625

Closed
vsfeedback opened this issue Dec 2, 2021 · 3 comments
Closed

"Getting started" MAUI App does not run on Windows #3625

vsfeedback opened this issue Dec 2, 2021 · 3 comments
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/windows 🪟 t/bug Something isn't working

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
"my" first MAUI App throws a 'System.Runtime.InteropServices.COMException' in Microsoft.WindowsAppRuntime.Bootstrap.Net.dll

Running Microsoft Visual Studio Community 2022 (64-bit) - Preview, Version 17.1.0 Preview 1.1 with these workloads

  • Mobile development with .NET
  • .NET desktop development
  • Universal Windows Platform development

The steps below reproduced the issue both before and after I ran a repair of the VS Community install.

Repro:

  1. steps 1 - 3 at https://docs.microsoft.com/en-us/dotnet/maui/get-started/first-app
  2. uncomment the windows target frameworks tag in MauiApp1.csproj
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
  3. update NUGet packages Microsoft.Graphics.Win2D to 1.0.0.30 and Microsoft.WindowsAppSDK 1.0.0
    (until doing this update the net6.0-windows10.0.19041 dependency is shown as broken)
  4. choose the net6.0-windows10.0.19041 target in the Framework dropdown
    (automatically selects "Windows Machine" as debug target)
  5. build MauiApp1.csproj -> a bunch of warnings:
Build started...
1>------ Build started: Project: MauiApp1, Configuration: Debug Any CPU ------
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.props(25,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.props" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.props (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets(77,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.References.targets" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.targets (76,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets(78,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.AppX.targets" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.targets (77,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets(79,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.NET.Markup.Compiler.targets" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.targets (78,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets(80,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.targets" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.targets (79,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>C:\Users\dev\.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets(82,3): warning MSB4011: "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.Build.Msix.targets" cannot be imported again. It was already imported at "C:\Users\dev\.nuget\packages\microsoft.windowsappsdk.winui\1.0.0-experimental1\buildTransitive\Microsoft.WinUI.targets (81,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\dev\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]
1>Parsing of manifest successful.
1>
1>MauiApp1 -> C:\Users\dev\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-windows10.0.19041\win-x64\MauiApp1.dll
1>Done building project "MauiApp1.csproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  1. Start Debugging [F5] -> COMException in bootstrapper:
'MauiApp1.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Users\dev\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-windows10.0.19041\win-x64\AppX\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Users\dev\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-windows10.0.19041\win-x64\AppX\MauiApp1.dll'. Symbols loaded.
'MauiApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Users\dev\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-windows10.0.19041\win-x64\AppX\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Users\dev\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-windows10.0.19041\win-x64\AppX\Microsoft.WindowsAppRuntime.Bootstrap.Net.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.Runtime.InteropServices.COMException' in Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
The program '[16796] MauiApp1.exe' has exited with code 2148734499 (0x80131623).

[MauiApp1.csproj] (https://aka.ms/dc/file?name=Ba7e30b4ab67a4eb6a1a83cd435b10724637738589192396604_MauiApp1.csproj&tid=a7e30b4ab67a4eb6a1a83cd435b10724637738589192396604)


Original Comments

Feedback Bot on 11/30/2021, 01:49 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

@jsuarezruiz jsuarezruiz added area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/windows 🪟 labels Dec 2, 2021
@Dbquity
Copy link

Dbquity commented Dec 8, 2021

Any advice on this?
I have not yet been able to run a MAUI app on Windows using VS 2022 Preview.

@Dbquity
Copy link

Dbquity commented Dec 9, 2021

I was able to work around this issue by manually changing the very last ItemGroup tag to

<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
    <!-- Required - WinUI does not yet have buildTransitive for everything -->
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
    <PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.30" />
</ItemGroup>

It seems that instead of replacing the contents of that tag, updating the NUGet packages Microsoft.Graphics.Win2D and Microsoft.WindowsAppSDK in step 3 of the repro steps above added another, conflicting tag.

@jfversluis
Copy link
Member

The Docs page has been updated and I think the out of the box experience is much better now. If there are still issues, please open a new one with all the (updated) details, thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 25, 2022
@samhouts samhouts added the t/bug Something isn't working label Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants