Run as Administrator no longer works #2855

Closed
opened 2026-01-30 23:07:11 +00:00 by claunia · 8 comments
Owner

Originally created by @DJackman123 on GitHub (Jul 19, 2019).

With the latest build I am no longer able to launch Terminal as administrator. This isn't the same as #1872 because I only get the UAC prompt once and I'm not seeing the other message box as is reported there.

I was able to determine that this problem was introduced with commit 8ffff8e (#1948).

Environment

Windows build number: 10.0.18362.10005
Windows Terminal version (if applicable): 0.2.1991.0

Any other software?

Steps to reproduce

Try to launch the app as administrator

Expected behavior

UAC prompt appears then the elevated Terminal runs

Actual behavior

UAC prompt appears and the border of a window is displayed but the process hangs at that point. I have to kill the process with Task Manager.

Originally created by @DJackman123 on GitHub (Jul 19, 2019). <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> With the latest build I am no longer able to launch Terminal as administrator. This isn't the same as #1872 because I only get the UAC prompt once and I'm not seeing the other message box as is reported there. I was able to determine that this problem was introduced with commit 8ffff8e (#1948). # Environment ```none Windows build number: 10.0.18362.10005 Windows Terminal version (if applicable): 0.2.1991.0 Any other software? ``` # Steps to reproduce Try to launch the app as administrator # Expected behavior UAC prompt appears then the elevated Terminal runs # Actual behavior UAC prompt appears and the border of a window is displayed but the process hangs at that point. I have to kill the process with Task Manager.
Author
Owner

@metathinker commented on GitHub (Jul 19, 2019):

I've also been able to reproduce this problem on my own build of Terminal master (dca0ffe6dd) and was about to file my own bug!

the border of a window is displayed but the process hangs at that point

I've found that:

  • the application only freezes in the debug build; the release build crashes quickly
  • after some time, the app will unfreeze and you'll get a Microsoft CRT dialog warning you that abort() was called, which you can use to kill the app.

From my debugging, it appears that Terminal crashes when trying to activate the Windows Runtime class TerminalApp.TitlebarControl; RoGetActivationFactory() returns "Class not registered" (HRESULT REGDB_E_CLASSNOTREG == 0x80040154).

This class was introduced yesterday as part of the faulty change 8ffff8ea37 (PR #1948) noted above. I verified that rebuilding Terminal after going back to the immediately previous commit makes the problem disappear.

@metathinker commented on GitHub (Jul 19, 2019): I've also been able to reproduce this problem on my own build of Terminal master (dca0ffe6dd0f76ca7997807424a2c08684e07751) and was about to file my own bug! > the border of a window is displayed but the process hangs at that point I've found that: - the application only freezes in the debug build; the release build crashes quickly - after some time, the app will unfreeze and you'll get a Microsoft CRT dialog warning you that abort() was called, which you can use to kill the app. From my debugging, it appears that Terminal crashes when trying to activate the Windows Runtime class `TerminalApp.TitlebarControl`; RoGetActivationFactory() returns "Class not registered" (HRESULT REGDB_E_CLASSNOTREG == 0x80040154). This class was introduced yesterday as part of the faulty change 8ffff8ea37a21265872e658145bcebf999d12594 (PR #1948) noted above. I verified that rebuilding Terminal after going back to the immediately previous commit makes the problem disappear.
Author
Owner

@metathinker commented on GitHub (Jul 19, 2019):

I can reproduce the problem reliably when I run my own build of Terminal master after deploying the loose-file app package folder with PowerShell.

As a (possibly misleading!) point of interest, when I run the WindowsTerminal.exe "directly" from the loose-file package folder, rather than doing so by the Start menu or another UWP app activation path, a crash occurs at the same place regardless of whether the app is elevated or not.

@metathinker commented on GitHub (Jul 19, 2019): I can reproduce the problem reliably when I run my own build of Terminal master after deploying the loose-file app package folder with PowerShell. As a (possibly misleading!) point of interest, when I run the `WindowsTerminal.exe` "directly" from the loose-file package folder, rather than doing so by the Start menu or another UWP app activation path, a crash occurs at the same place regardless of whether the app is elevated or not.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 20, 2019):

This is a silly and complicated issue. At the heart of it:

Centennial applications that depend on WinRT classes cannot be launched as Administrator. Period. This is a bug, and one that's not likely to be fixed for a while. I'll go into details if somebody wants. 😄

EXCEPT: in 19H1, the app platform team introduced "side-by-side" registration-free WinRT. It's the same thing that makes double-click activation work for Windows Terminal! @metathinker correctly identified this, and it's not misleading at all.

We just have to keep a completely separate list of all activatable runtime classes in sync with the one in the AppX manifest.

This was difficult until 18362, when the manifest tool mt sprouted the ability to generate a manifest fragment from a WinMD file. Suddenly, life became worth living again.

The pull request #2043 finally lands some work that's been on my dev branch for three months. It should fix this entire class of issues, possibly forever.

@DHowett-MSFT commented on GitHub (Jul 20, 2019): This is a silly and complicated issue. At the heart of it: Centennial applications that depend on WinRT classes _cannot_ be launched as Administrator. Period. This is a bug, and one that's not likely to be fixed for a while. I'll go into details if somebody wants. :smile: EXCEPT: in 19H1, the app platform team introduced "side-by-side" registration-free WinRT. It's the same thing that makes double-click activation work for Windows Terminal! @metathinker correctly identified this, and it's not misleading at all. We just have to keep a completely separate list of all activatable runtime classes _in sync_ with the one in the AppX manifest. This was difficult until 18362, when the manifest tool `mt` sprouted the ability to generate a manifest fragment from a WinMD file. Suddenly, life became worth living again. The pull request #2043 finally lands some work that's been on my dev branch for three months. It should fix this entire class of issues, possibly forever.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 20, 2019):

And just to call out: 8ffff8e was not faulty; the existence of a split parallel universe manifest is what was faulty.

@DHowett-MSFT commented on GitHub (Jul 20, 2019): And just to call out: 8ffff8e was not faulty; the existence of a split parallel universe manifest is what was faulty.
Author
Owner

@fjpmota commented on GitHub (Jul 20, 2019):

I had roughly the same problem - when I tried to run the application as an administrator I was getting 2 UAC prompts and then gave an error message. I managed to overcome the problem by installing the app in the administrator user profile. After that I can already launch the app as an administrator from my profile.

@fjpmota commented on GitHub (Jul 20, 2019): I had roughly the same problem - when I tried to run the application as an administrator I was getting 2 UAC prompts and then gave an error message. I managed to overcome the problem by installing the app in the administrator user profile. After that I can already launch the app as an administrator from my profile.
Author
Owner

@metathinker commented on GitHub (Jul 20, 2019):

@fjpmota your particular problem sounds like it could actually be issue #1872, not this one.

@metathinker commented on GitHub (Jul 20, 2019): @fjpmota your particular problem sounds like it could actually be issue #1872, not this one.
Author
Owner

@fjpmota commented on GitHub (Jul 20, 2019):

@metathinker you're probably right. the error message matches the one I was getting

@fjpmota commented on GitHub (Jul 20, 2019): @metathinker you're probably right. the error message matches the one I was getting
Author
Owner

@huoyaoyuan commented on GitHub (Jul 21, 2019):

in 19H1, the app platform team introduced "side-by-side" registration-free WinRT.

I'm very interested in this. @DHowett-MSFT are there any further information available? I can't find it in "what's new in Windows 10 for developers".

@huoyaoyuan commented on GitHub (Jul 21, 2019): > in 19H1, the app platform team introduced "side-by-side" registration-free WinRT. I'm very interested in this. @DHowett-MSFT are there any further information available? I can't find it in "what's new in Windows 10 for developers".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2855