dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

Maui blazor app fails to lunch after publish on win 10 desktop + Unable to load DLL 'Microsoft.ui.xaml.dll' #5729

Closed devna13 closed 2 years ago

devna13 commented 2 years ago

Description

.Net Maui blazor app runs using Microsoft Visual Studio (Community 2022 (3) (64-bit) - Preview Version 17.2.0 Preview 2.1) but it fails to lunch after publishing on windows 10.

Event viewer error

Application: Cur.Dr.MapFileBuilder.Native.exe
CoreCLR Version: 6.0.222.6406
.NET Version: 6.0.2
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
   at Cur.Dr.MapFileBuilder.Native.WinUI.Program.XamlCheckProcessRequirements()
   at Cur.Dr.MapFileBuilder.Native.WinUI.Program.Main(String[] args)

Publish settings:


Update enabled False
Manifests signed False
Configuration Release
Target Framework net6.0-window510.0.19041
Target Runtime win-x64
Deployment mode Self-contained

Package.appxmanifest

<?xml version="1.0" encoding="utf-8"?>

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="uap rescap">

  <Identity
    Name="2C8607D2-1281-4FE8-8544-D310BFAD4E28"
    Publisher="CN=User Name"
    Version="1.0.0.0" />

  <Properties>
    <DisplayName>Cur.Dr.MapFileBuilder.Native</DisplayName>
    <PublisherDisplayName>Microsoft</PublisherDisplayName>
    <Logo>Resources\Images\gen\appiconStoreLogo.png</Logo>
  </Properties>

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
  </Dependencies>

  <Resources>
    <Resource Language="x-generate"/>
  </Resources>

  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="$targetentrypoint$">
        <uap:VisualElements  />
    </Application>
  </Applications>

  <Capabilities>
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>

</Package>


### Steps to Reproduce

1. Create a File > New .NET MAUI Blazor App
2. Publish To Folder or Click once app 
3. Go to published folder and try to install and run the app

### Version with bug

Preview 14 (current)

### Last version that worked well

Preview 14 (current)

### Affected platforms

Windows

### Affected platform versions

<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>

### Did you find any workaround?

_No response_

### Relevant log output

_No response_
v-longmin commented 2 years ago

@devna13 Could you share your repro project for us? Thanks.

ghost commented 2 years ago

Hi @devna13. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jfversluis commented 2 years ago

Thanks for the report, we're aware of this one and it's being tracked in multiple issues already. One of which is #4329, more specifically #5024. In the latter there is also a workaround being mentioned and it should be fixed for the next release. Thanks!

rborosak commented 2 years ago

@jfversluis The workaround does not work :)

devna13 commented 2 years ago

@jfversluis thanks a lot for the info, this is a show stopper as we can't push the app to production (workaround didn't work for me)