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

Having Windows app run as admin & unpackaged does not work. #13690

Closed
0x14307 opened this issue Mar 3, 2023 · 2 comments
Closed

Having Windows app run as admin & unpackaged does not work. #13690

0x14307 opened this issue Mar 3, 2023 · 2 comments
Labels
platform/windows 🪟 t/bug Something isn't working

Comments

@0x14307
Copy link

0x14307 commented Mar 3, 2023

Description

While attempting to build an unpackaged app that also runs as administrator, the compiler gives the error Values of attribute "level" not equal in different manifest snippets. as well as another error regarding the Windows SDK build tools exiting.

Steps to Reproduce

Add <WindowsPackageType>None</WindowsPackageType> to a PropertyGroup in your .csproj file

Change MsixPackage to Project in launchSettings.json.

Add:
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> to app.manifest in Platforms/Windows

and also add <rescap:Capability Name="allowElevation" /> under the Capabilities section in the Package.appxmanifest

Link to public reproduction project repository

https://github.com/glebinski/MauiBug

Version with bug

6.0.312

Last version that worked well

6.0.312

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.17763.0

Did you find any workaround?

Currently, I have not. The only workaround I have been able to do is to either have it run unpackaged and as a regular user or have it MSIX packaged & as an admin.

Relevant log output

No response

@0x14307 0x14307 added the t/bug Something isn't working label Mar 3, 2023
@drasticactions
Copy link
Contributor

#10564

Unpackaged is not currently supported.

@0x14307
Copy link
Author

0x14307 commented Mar 6, 2023

Worked around this issue by calling the process I want to run as a separate administrator process 👍

@0x14307 0x14307 closed this as completed Mar 6, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants