Windows 10: Asking for Administrator permission in a WPF application despite setting...

Discus and support Asking for Administrator permission in a WPF application despite setting... in Windows 10 Gaming to solve the problem; 0I developed a WPF application using .NET 5 and I must run it with administrator privileges. I have created a setup project and added the primary... Discussion in 'Windows 10 Gaming' started by Syam Sundar1, Jun 29, 2023.

  1. Asking for Administrator permission in a WPF application despite setting...


    0I developed a WPF application using .NET 5 and I must run it with administrator privileges. I have created a setup project and added the primary output of my WPF application to it.To accomplish this, I have made sure to set the requestedExecutionLevel attribute to "requireAdministrator" within the application manifest file app.manifest.However, I have encountered an issue where the application does not initiate with elevated privileges as intended. Instead, it prompts the user for Administrator permission when launched.I would greatly appreciate any insights, guidance, or solutions to help

    :)
     
    Syam Sundar1, Jun 29, 2023
    #1
  2. MrSeanKon Win User

    Enable visual styles in WPF application

    EUREKA!

    Steps:
    1) I made a Windows form (HostWPF namespace, Form1 is the form).
    2) I added a reference => System.Windows.Forms.Integration which contains classes that enable interoperation between the Windows Forms and WPF technologies. When you use System.Windows.Forms.Integration classes, you can host Windows Forms controls on WPF pages, and WPF elements in Windows Forms-based applications.
    3) Then added a control (damn Vi$ual $tudio 2010 does not allow to add a WPF window) but after adding I edited the XMAL code in the way I want *Wink Asking for Administrator permission in a WPF application despite setting... ;)
    4) The next steps are simple. Download the first attachment. But => see the photo.
    It crashes!!!!!
    5) Finally???
    We must use System.Windows.Forms.Application.Exit(); command because the WPF window behaves like a classical Windows Form.
    Download the second attachment. Note that the Windows form's name is Initial.
    Enjoy!
     
    MrSeanKon, Jun 29, 2023
    #2
  3. Xylee Del Win User
    How to always allow administrator permissions for a specific application

    Hi Lyon,

    Windows 10 gives users the ability to customize how they run applications. We suggest that you follow the steps below on how to grant administrator permission to a specific application:

    • Click the Windows icon on your Windows 10 screen that will open the list of applications. Right click on the specific application that you wish to have an admin permission, click the
      More and click Open file location.
    • A new window will open to the location of the program. Right-click on the program and click
      Properties from the pop-up menu.
    • In the Properties window, click the Shortcut tab and then click
      Advanced.
    • In the Advanced Properties window, check the box next to
      Run as administrator
      and click OK.
    • The program will now open in administrator mode when you click the shortcut from the Start menu. Repeat the steps above for other desired applications.

    Let us know if you need further assistance.
     
    Xylee Del, Jun 29, 2023
    #3
  4. Maria Fab Win User

    Asking for Administrator permission in a WPF application despite setting...

    Error of asking permission from the administrator

    Hello,

    The error message that asks permission usually appears when you don't have administrator rights to copy a file or folder. To determine the cause of the issue, we'd like to ask a few questions:

    • What is the exact error message that you're getting?
    • Were you able to copy files before without any error?
    • Were there any changes made on your PC prior to this?

    Meanwhile, we suggest that you follow the steps provided by Niranjan Manjhi on this
    post. It includes guidelines on how to take ownership of a file or folder,
    turn off the User Account Control (UAC) which is necessary in preventing unauthorized changes to your computer, and enabling the hidden built-in administrator account on your PC. This was marked as an answer and a lot of Community members
    claimed it as helpful and that it solved their problem.

    Please update us with the results. We will be glad to assist you.
     
    Maria Fab, Jun 29, 2023
    #4
Thema:

Asking for Administrator permission in a WPF application despite setting...

Loading...
  1. Asking for Administrator permission in a WPF application despite setting... - Similar Threads - Asking Administrator permission

  2. Asking for Administrator permission in a WPF application despite setting...

    in Windows 10 Software and Apps
    Asking for Administrator permission in a WPF application despite setting...: 0I developed a WPF application using .NET 5 and I must run it with administrator privileges. I have created a setup project and added the primary output of my WPF application to it.To accomplish this, I have made sure to set the requestedExecutionLevel attribute to...
  3. Asking for Administrator permission in a WPF application despite setting...

    in AntiVirus, Firewalls and System Security
    Asking for Administrator permission in a WPF application despite setting...: 0I developed a WPF application using .NET 5 and I must run it with administrator privileges. I have created a setup project and added the primary output of my WPF application to it.To accomplish this, I have made sure to set the requestedExecutionLevel attribute to...
  4. asked parent permission despite being adult

    in User Accounts and Family Safety
    asked parent permission despite being adult: I am an 18 year old man but my microsoft account keeps asking for parent permission and i have no clue where it even sends the message, not to mention i am set to being 18 on my account and am not set to a child account...
  5. asked parent permission despite being adult

    in Windows 10 Gaming
    asked parent permission despite being adult: I am an 18 year old man but my microsoft account keeps asking for parent permission and i have no clue where it even sends the message, not to mention i am set to being 18 on my account and am not set to a child account...
  6. asked parent permission despite being adult

    in Windows 10 Software and Apps
    asked parent permission despite being adult: I am an 18 year old man but my microsoft account keeps asking for parent permission and i have no clue where it even sends the message, not to mention i am set to being 18 on my account and am not set to a child account...
  7. Access denied despite administrator permissions

    in Windows 10 Gaming
    Access denied despite administrator permissions: Hi there,using this forum as a last resort because I'm at my wit's end.I have the Xbox Games app installed on my Windows 11 only updated a couple days ago machine and I don't seem to have any permissions on the game folders.If I go to "Accounts > Your info" it clearly shows...
  8. Access denied despite administrator permissions

    in Windows 10 Software and Apps
    Access denied despite administrator permissions: Hi there,using this forum as a last resort because I'm at my wit's end.I have the Xbox Games app installed on my Windows 11 only updated a couple days ago machine and I don't seem to have any permissions on the game folders.If I go to "Accounts > Your info" it clearly shows...
  9. "Ask Permission" Error for Application

    in User Accounts and Family Safety
    "Ask Permission" Error for Application: Hello, Recently I have disabled family features on my windows 10 computer. But whenever I go on to google chrome it says 'Ask for permission' so I click on 'ask by email' and an error message pops up saying 'Something went wrong. I am confused about this because even after I...
  10. Set Administrator permissions

    in Windows 10 Customization
    Set Administrator permissions: How do I set Administrator permissions on Windows 10 https://answers.microsoft.com/en-us/windows/forum/all/set-administrator-permissions/1131797f-72d0-45c6-98fa-eba153fbc887