views:

387

answers:

6

I have a C# WinForms application that has "uiAccess" set to "True" in it's manifest file. When I try to start/debug it in Visual Studio 2008 SP1 under Windows 7 x64 (RTM) I get this error:

Running an Accessibility application requires following the steps described in Help.

The help button is a broken link, and clicking ok just closes the application. It is digitally signed, and I can start it just fine in Windows Explorer. Here is the same bug in MS Connect, but unfortunately it's closed:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=384183

Question: Can anyone else using Vista/Win7 x64 (with UAC enabled) confirm that they experience the same problem? Has anyone seen this problem before and have any idea how to work around it?

A: 

Try to run Visual Studio with administrators privileges. (Just right-click on it's icon and click on Run As Administator.

When you run Visual Studio with administrative privileges, any process created by it will have administrative rights and UAC will not appear. So when you debug you applications it will have privileges by default.

Isaac
I am running VS as an administrator using the technique you described. This isn't a prompt asking me if I want to run the application, VS is telling me it can't run it and not providing any more information.
Jon Tackabury
A: 

It looks like Visual Studio 2010 still has the same issue. I'm surprised that I'm the only person who has run into this issue, but it looks like it's not something that MS will be fixing. :(

Jon Tackabury
A: 

I also have the same problem. Even if I turn off the "Only elevate UIAccess applications that are installed in secure locations" in Local Security Policy

Mo0gles
+1  A: 

I have the same problem too. I run a custom build step to Authenticode sign the file. The program runs fine in user mode.

Simeon
+1  A: 

I have just run into this issue, in a C++ program. If I come up with any solutions I will report back.

Dale Stewart
Excellent. :) I still have this issue, any help is much appreciated.
Jon Tackabury
I found that the code has to be signed, and this article shows how to create a test certificate to do that:http://www.windows-tech.info/14/cee0473e5383520d.phpHowever, there appears to be more to it than that. Still struggling with it. There also appears to be a requirement that the executable be in the Program Files or Windows folder, but that is also not the complete solution, as far as I can tell. I have a need to use the SendInput() function, which requires uiAccess to be true.
Dale Stewart
A: 

Had the same problem with a C++ app trying to run from dev studeio. I set UAC Bypass UI Protection back to false in the project settings, then changed UAC Execution Level to requireAdministrator, and that seems to fix it for me.

yosef