Reputation: 3156
Is there an option in the application properties ? I cannot find anything that tells Visual Studio that my application will need to be run in an elevated state.
Upvotes: 0
Views: 606
Reputation: 7537
If you're just trying to do this on your development machine, you could:
Log in as the Administrator and run Visual Studio -OR- Right-click the Visual Studio shortcut and click "Run As" and supply the Administrator account credentials.
If this is for an application you are developing to live on a server where the server cannot be left logged in as an Administrator while your application runs, you should either:
Info on Impersonation:
Without information about your app, i.e. if it is a web app or standard exe or SharePoint web page, it's hard to give you more specific info. For .NET web apps, ensure you use Windows authentication and set your app pool to run under the account with Admin privileges. Note that you may still need to add the Impersonation code into your app where you need the higher privileges, even if it is running under that account.
For SP pages, you need SPSecurity.RunWithElevatedPrivileges(function(){ ... });
Upvotes: 1