Skip to main content

 none
Debugging with uiAccess=true RRS feed

  • Question

  • My application requires uiAccess=true in manifest file and becomes digitally signed during post build event.

     

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


    When I try to run my application from the debugger with VS2008 or VS2010 I get the following error:


    Error while trying to run project: Unable to start program [Application].

    The application manifest has the uiAccess attribute set to 'true'.
    Running an Accessibility application requires following the steps
    described in Help.


    [OK] [Help]


    But the help button is redirecting me to a "Page not found"-Website.


    Is it even possible to debug an application with uiAccess=true ?



    Martin

    Monday, October 18, 2010 9:09 AM

Answers

  • Hi, Martin,

    We run into this often in the product team (Narrator, Magnifier, etc. all run with UI Access).  We usually start the process, and then attach an elevated debugger.  If you need to debug something in startup, a simple workaround is to call MessageBox first thing, such that your process waits for you to attach the debugger.  It sounds funny, but it works for us.

    To support your mental model: UIAccess is much like running elevated: the system has to kill your process, and then re-start it with higher privileges, since a process, once started, cannot acquire new privileges. Ex nihilo nihil fit.  Since your process gets killed, you can't run it from the debugger.  Hence, the workaround to attach afterwards.

    I'll inquire into why the help link is broken. 

    Thanks,
    Michael


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, October 29, 2010 4:28 PM

All replies

  • I just found this on microsoft connect, but unfortunately it's already closed.

    http://connect.microsoft.com/VisualStudio/feedback/details/384183/uiaccess-true-and-digitally-signed-executables-that-call-setwindowshookex

    Is there anyone who was ever able to debug an application with uiAccess in manifest?

    Martin

    Thursday, October 21, 2010 7:59 AM
  • Hi, Martin,

    We run into this often in the product team (Narrator, Magnifier, etc. all run with UI Access).  We usually start the process, and then attach an elevated debugger.  If you need to debug something in startup, a simple workaround is to call MessageBox first thing, such that your process waits for you to attach the debugger.  It sounds funny, but it works for us.

    To support your mental model: UIAccess is much like running elevated: the system has to kill your process, and then re-start it with higher privileges, since a process, once started, cannot acquire new privileges. Ex nihilo nihil fit.  Since your process gets killed, you can't run it from the debugger.  Hence, the workaround to attach afterwards.

    I'll inquire into why the help link is broken. 

    Thanks,
    Michael


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, October 29, 2010 4:28 PM
  • Hi Michael,

    that sounds like a very annoying way of debugging. I don't think that this will work for us, but I understand the problem. Thanks for explanation.

    Since then I debug my application without uiAccess and add uiAccess-attribute to manifest when a release build is required, but this is also annoying.

    Is it possible to automatize that somehow in VS? Maybe something like use Manifest-File A in debug configuration and Manifest-File B in release configuration?

    Thanks

    Martin

    Wednesday, November 3, 2010 9:05 AM
  • I'm not a VS ninja, I'm afraid, but I think you can do this with a custom build step.  If you add a pre-build step that copies the real manifest to a fixed location (which will be used when building the app), then the pre-build step can be different for Debug and Release, and therefore switch between manifests. 

    We use the run-and-attach method of debugging so often that I guess we've gotten used to it.

    Thanks,
    Michael


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, November 5, 2010 4:19 PM
  • Has this been fixed now? I am trying to do the same (uiAccess="true") in VS2012 and receive the same error message box while debugging. Help button is not leading me to any "steps" for rectifying it. The built .exe is also throwing the following error-
    A referral was returned from the server.


    Awaiting reply,
    Abhinav
    Thursday, September 19, 2013 6:00 PM
  • I came here for the same reason, VS2008 showed that message box with broken link.

    It would be funny, weren't it so sad. MS can't fix a broken link in their online help in three years?


    --- failed to load signature ---

    Wednesday, December 4, 2013 9:26 AM
  • Well. It's Microsoft. I've come to expect nothing better.
    Tuesday, December 31, 2013 6:22 PM
  • I'am here for this reason too!
    I'am using Windows 7 64 bit (and c#), but i am compiling to 32 bit (with VS. 2012). My code is unsafe code. I'am using my unmanaged c++ dll.


    Sorry, i have the resolution:
    I updated the Windows, rebooted the system, and i can run my program now. Thank You for the update! (Earlier: i turned of the Windows update, because i hate, when the Windows doing automatic update while i'am working.)





    Wednesday, February 5, 2014 12:14 PM
  • Das ist schon eine nicht mehr nachvollziehbare weitere Einschränkung für Entwickler die sich dem App-Sülz nicht unterwerfen.
    Es ist damit zu rechnen das als bald nur noch Scriptsprachen zulässig werden.
    Codeerstellung wird verboten in der Zukunft. 
    Schade das diese Entwicklung von den Schlüsselhaltern so massiv unterstützt wird. 

    Friday, December 29, 2017 1:08 PM
  • It has been eight years and Microsoft is unable to fix a broken link on their own website. LOL
    Friday, December 14, 2018 3:31 AM
  • Ja, es wird zeit fur ein Europäisch Betriebssystem ohne einschrankungen...
    Sunday, February 10, 2019 12:57 AM