I am learning C#, my application needs to run on Vista and 7, but UAC turned on always reports error of access violation. I tried Right-Click-To-Run-As-Admin but it didn't help. How can I run the application without turning it off ?
Thank you.
Printable View
I am learning C#, my application needs to run on Vista and 7, but UAC turned on always reports error of access violation. I tried Right-Click-To-Run-As-Admin but it didn't help. How can I run the application without turning it off ?
Thank you.
You need a manifest file. When you run your application, the UAC dialog will pop up to ask permision for you application.
Just google for 'C# manifest' and I'm sure you'll find something usefull.
Like Danny said, a manifest file is the way to go if you *absolutely* need to run as an admin. However, you should ask yourself if you actually need this in the first place. You very may well need admin privileges, but if you post the problem at hand we may be able to help you find a way around it.
Thank you,
I only copy and paste a code snip on the net into my Console to loop through my Cdrive's directories to display all files, but I am reported as unable to access some folder without an admin priviledge. I right click my application.exe but the problem remains at a different location. I wonder how different it becomes to use a manifest to run as an admin and to choose Run as Admin by rightclick of my mouse ?
If a manifest works best always through Vista and 7's security, then I guess MFC's life is going to end very soon :(, am I correct ? Or is it that people might have 'immigrated' into C# long before I think so ?
Why do you think that an MFC application would be unable to request administrative privileges?