Visual Studio 2005 Output file requires Administrative Privileges - visual-studio

Using Visual Source Safe 2005, I downloaded a jobmate's project in my computer and built it correctly, but when I press "play" to debug it I receive an error message telling me that I need higher privileges.
Looking around, I've noticed that the freshly build program has the little shield icon that means that I need administrator permission to run it and actually, if I run it outside Visual Studio, I manage to execute it after the UAC question.
I'm domain and local administrator so I can disable UAC, but I don't think this is the solution, so: what can make my program to require administrative privileges?

Related

Visual Studio 2010 not start(run) as administrator

I have visual studio 2010 installed in Windows-7 OS. It works properly in normal mode or as a normal user but if I run it as administrator then it will show splash screen and after that give error message like "Application cannot start".
I also tried to make it always run as administrator by changing its compatibility property and mark there Run as administrator but in that case also VS not started.
If I turn on UAC and after that try to run VS then it will prompt for permission to run as administrator but then also failed to start.
Is there any solution for this problem?

Debugging with Visual Studio 2012, Windows 8 and User Account Control

First of all - this is all about the RTM Versions. And Windows 8 has some changes regarding the UAC, as we all learned from http://www.brianbondy.com/blog/id/140/, it cannot be disabled side-effect-free.
Now the problem starts:
Our main app requires elevated privileges (at least the server part). Debugging will only work when running VS in elevated mode, too. But when I'm starting a Silverlight Project in elevated mode of VS, the IE fired up for debugging is started as with normal privileges and debugging is not possible, too. To make things more complicated, we're not running solutions with all (700+) projects loaded, but do lot of our dev-stuff (compiling, starting, testing) in command line. Which needs to be elevated, too.
What is the correct configuration of UAC for this purpose: I want to be able to debug Silverlight applications running in Internet Explorer, Applications of any kind started by VS "F5", a server process started from commandline and (maybe) C#/XAML Metro-Apps?
In Windows 7 it was just disabling UAC and everything's fine. Now I feel like fighting against my own toolset and have a bad feeling about this.
And please - do not tell me that UAC is important and useful. I'm totally okay with it, but for a developer things are slightly different.
See this answer on Superuser:
The Only way I'm aware of which ensures it will always open as
Administrator (including when you open from file associations, jump
list etc) is:
Locate the devenv.exe file in Explorer eg mine is in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\
Right-click devenv.exe and choose "Troubleshoot compatibility"
Select "Troubleshoot program"
Select "This program requires additional permissions"
You'll need to let it launch VS before it lets you click Next, but
then you're done.
EXTREMELY annoying that you can't just do this through the normal
properties dialog any more. It's like Microsoft are going out of their
way to ensure Windows 8 alienates as many people as possible...
Have you tried installing VSCommands and using the Always start Visual Studio with elevated permissions option? I'm not sure how this would function differently than restarting with elevated permissions but it can't hurt to try.
I ran into the same issues with the command line, debugging, and other things such as once you're running with elevated permissions you can no longer drag & drop files into Visual Studio, or open files associated with Visual Studio when it's set to always run with elevated permissions. This is why I've always disabled UAC.
In the end I just turned off UAC in the registry. I'm not missing out on anything by doing so. It would be nice to hear how Microsoft uses the Win8 + VS2012 combo internally after seeing how broken it feels.

Need to debug process as a non admin (VS2010)

I am running the following
Win7 SP1 Enterprise
VS2010 Pro SP1
Non admin user
I need to attach to the w3wp.exe process
I have assigned myself debug privs via GPO
When attempting to attach to the process I get
Microsoft Visual Studio
Unable to attach to the process. Visual Studio has insufficient privileges to debug this process. To debug this process, Visual Studio must be run as an administrator.
The main issue is I need to debug a site that handles multiple hostheaders (sitecore)
Cassini has no concept of hostheaders
IISExpress does not handle hostheaders - cannot launch site with different hostheaders*
Is there an alternative around this ?
Side note
I have tried to give myself admin token with the following as a test as well
http://www.scriptlogic.com/products/privilegeauthority/
VS launches as an 'admin' but gives me the whole Unable to attach to the process. Visual Studio has insufficient privileges to debug this process.
Side note 2
Using process explorer on devenv.exe doesn't show the SeDebugPrivilege enabled
I have tried using ntrights.exe to grant the rights - rebooted and still not there.
If you have an admin password you can (when you open VS) right click, and then say 'run as administrator', otherwise you just may be out of luck as far as I know.
This link here: Working with Web Projects in Visual Studio as a Non-Administrative User says it clearly:
You cannot attach to a process that is running under the IIS worker
process because it requires administrative privileges.
We ended up using http://www.scriptlogic.com/products/privilegeauthority/ granting the SeDebug Token as well.
This worked out well as we could also apply this to other products like ants profiler which needed admin rights to run (wasn't required for XP)

Debug a program that needs administrator rights under Windows 7

I'm running Visual Studio 2008 on Windows 7 64-bit. I'm logged in as administrator, and I'm running it as administrator, but the program I'm working on fails with access denied when I call a restricted API. If run the program from Explorer with "Run as Administrator" it works.
I was under the belief that Visual Studio 2008 debugs programs with whatever rights Visual Studio 2008 itself is running with. As it stands I can't debug my application due to this, and I'm at a loss as to what's going on.
This works for Visual Studio 2012.
Create a manifest file: right click on the project and select "Add New Item", select "Application Manifest File". This will add a file named app.manifest to the project.
Edit manifest file: set attribute level for tag requestedExecutionLevel to requireAdministrator.
Now your program will always require admin privileges, wherever it is executed. If launched by Visual Studio debugger, it will prompt you for restarting Visual Studio as administrator, if needed.
It's best to run Visual Studio 2008 as administrator. Moreover, it's good to change your application's manifest settings to require administrator privileges. You will be prompted by the system to elevate to system administrator each time you start your application, and when running under Visual Studio 2008 the IDE will offer you the elevation before start of debugging.
To change the setting, open project properties and go to Configuration Properties → Linker → Manifest file → UAC Execution Level.
I found the answer. It turns out that it is, in fact, a manifest issue: by default if you have a manifest you need to set the appropriate administrator privilege.
The default is asInvoker, but that doesn't work if you need elevated privileges; you instead have to set it to requireAdministrator in the manifest properties.
Run Visual Studio 2008 as administrator.
I had a case where I put in the
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
settings (described by another answer at this post)........and did not work.
I found another tip (seen below)...and unchecking that option allowed my code to work.
Try going into the project properties, and under the "debug" tab,
uncheck "enable the Visual Studio hosting process" and see if that
fixes your problem.
(from https://social.msdn.microsoft.com/Forums/vstudio/en-US/b5c4da93-5d64-442e-af28-df6d10765538/debug-as-administrator?forum=vbgeneral)
So I needed the app.manifest settings AND the "uncheck".
My testing with Windows Vista and Visual Studio 2005 showed that when you use a host process, the behavior under the debugger depends only on how you launched Visual Studio and not on the manifest (or lack of manifest) of your application. When Visual Studio is launched elevated, the behavior depends only on the use (or not) of a host process, not on the manifest. This is probably still true with Windows 7 and Visual Studio 2008.
Also, have you tried launching the application outside Visual Studio and using Attach to Process?

Debug or build as non-admin in Visual Studio 2008

I am trying to install Visual Studio 2008 at a university's computer lab. The lab machines (XP Pro) are configured so that students don't have Administrator rights when they log in. So when I try to build or debug a class library project in Visual Studio 2008, I get this error: "Cannot register assembly 'C:\Documents and Settings(username)\My Documents\Visual Studio 2008\Projects\testproj\testproj\bin\Debug\testproj.dll' - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\test.cmdTest' is denied."
In previous versions of Visual Studio, there was the option to add the non-admin account to the Debugger Users and VS Developers groups, and this would enable them to debug and build DLLs. Does Visual Studio 2008 include similar functionality, and would this even be the solution? I'm not seeing the groups added with the installation. If this functionality is not included, is there another way to solve this issue? Allowing students to have Admin rights or Power User rights to the machines is out of the question.
Any suggestions, ideas, or insight would be much appreciated.
Why not just consider using some kind of virtualizations ? Install Visual Studio on a virtual machine, hence, every mess a student gonna make, is gonna be virtual to some extent.
Keep a ready and fresh copy of the image file though.
Probably not the answer you want, but you could start VS by right clicking VS2008/devenv.exe > "run as" and select administrator and have the lab tech enter the admin credentials. This way, VS2008 will have the required rights, but your school isn't giving out a sensitive Login/Password.
Your school should change the group policy to allow you to build your projects. Enlist the help of a friendly professor for that.
Are you doing a web application? I believe that for non-web applications, you do not need admin rights.
If this is not a web application, maybe it's just a file system permissions issue?
From:
http://msdn.microsoft.com/en-us/library/ms165100.aspx
"User permission requirements for Visual Studio vary depending on the operating system and the Visual Studio version. On Windows Vista, Visual Studio 2008 does not require administrator permissions to perform most tasks, but Visual Studio 2005 must run under administrator permissions to perform tasks correctly. On Windows Server 2003 and earlier, members of the Users group can perform most activities in the integrated development environment (IDE)."
It looks like you're trying to register the assembly in COM.
Access to the registry key
'HKEY_CLASSES_ROOT\test.cmdTest' is
denied."
Are you setting a [assembly:ComVisibleAttribute(true)] attribute in your assemblyinfo.cs or project properties? Try setting this to assembly:ComVisibleAttribute(false).

Resources