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

Publishing with uiAccess #23601

Closed tqphan closed 2 months ago

tqphan commented 2 months ago

Description

I'm trying to publish a .NET MAUI app on Windows with the following node added to the app.manifest.

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="true" />
    </requestedPrivileges>
  </security>
</trustInfo>

I followed the instructions on the official deployment documentation.

I copied the self-signed certificate to Trusted Root Certification Authorities under Local Machine.

When I try to run the app, I get the following error.

I also tried to run the app as administrator.

Steps to Reproduce

  1. Create an .Net Maui App
  2. Add the above XML node to app.manifest
  3. Deploy for Windows using a self-signed certificate
  4. Install the self-signed certificate to Trusted Authorities
  5. Install package and run the app

Minimal repository: https://github.com/tqphan/MauiDeployTest

Link to public reproduction project repository

https://github.com/tqphan/MauiDeployTest

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

drasticactions commented 2 months ago

Did you try this with a WinUI Template app that doesn't implement the MAUI UI Framework? Does it work there?

tqphan commented 2 months ago

I figured out the problem. UIAccess requires the executable to be signed and located in C:\Program Files\

Apparently the dotnet publish only sign the msix package and not the executable itself (bug or strange design decision?)