Debug or build as non-admin in Visual Studio 2008 - visual-studio

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).

Related

Visual Studio 2019 Installation can't get past package Microsoft.VisualStduio.MinShell.Msi.Resources

Every time I try to install Visual Studio 2019, I get the error "Microsoft.VisualStudio.MinShell.Msi.Resources could not be installed". I have tried everything I have found on the Internet. When I go to the Download folder of the Visual Studio Installer and I execute the .msi file directly of the package I get the error that it is forbidden due to a software group policy. It is my laptop and I am the admin, so there is no reason why it should be forbidden. I have Windows 10 Home and I am trying to install Visual Studio 2019 Enterprise(the Community edition also does not work).
Here is the Link to my Log files:
Download
Try the following suggestions:
1) delete any files under %Temp%
2) Check if there have 3rd party anti-virus software enabled or enterprise group policy in place that is restricting you or not.
3) type Administrative Tools in Windows search box - Open Local Security Settings -- Software Restriction Policies ( Note: If no software restrictions are defined, right click the Software Restriction Policies node and select New Software Restriction Policy) - Double click Enforcement - Select All users except Local Administrators - Click OK - Restart the computer for the changes to take effect.
4) enter Manage User Certificates under Search Box-->Untrusted Certificates-->remove any info about Microsoft.
enter
C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.MinShell.Msi.Resources,version=16.0.xxx.xxx and right-click on the folder-->Security--> make sure your current user account has the right to modify the folder.
Then, run VS_Installer as Administrator
5) Besides, if it does not help, please run C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe to reinstall the whole VS(all versions of VS2017 and VS2019), vs data, related registry information(do a deep uninstallation), then run vs_installer as Administrator to try again.
==============================================
Solution
Use the ccleaner tool to clean the os environment and disk and install the program without any errors.
I just had this happen to me on the Microsoft.VisualStudio.AspNetPackages.Msi.
I found this here.
They suggested to find the msi in the C:\ProgramData\Microsoft\VisualStudio\Packages and run it while the installer is paused. Then resume the install. and magically it worked for me.

Unable to launch Visual Studio 2015 as a different user

In order to limit my own destructive powers, I have two domain accounts, one for normal work and one for TFS admin stuff. For years I have been using the Run as different user feature for opening another Visual Studio window as my admin account whenever I need to do admin stuff. Both users is members of the local administrator group.
About a month ago this stopped working resulting in the below dialog instead of launching Visual Studio. Both option does nothing - no Visual Studio launches. The suggested link http://go.microsoft.com/fwlink/?LinkId=659046, refer to older Visual Studio versions: 2005, 2008 and 2010. I have Visual Studio 2015 Update 3 installed with the latest cumulative servicing update.
I have a feeling that it started after I installed Windows 10 1607 (Anniversary Update) - before I had Windows 10 1511, but I am not sure that something else caused the change. It is possible to open a command prompt as but admin user, but launching Visual Studio from here results in the same dialog. I have tried on another machine with 1607 with same result, and I can still get it to work on a machine with 1511. I have also tried with another user, but again the result is the same.
A workaround is using the Switch User feature of Windows but this makes it impossible to have a window e.g. Outlook open as my normal user switching back and forth.
Any suggestion on how to get around this?
Try to run Visual Studio using this command instead:
runas /netonly /user:<account> devenv.exe
This should be enough to have Visual Studio under a context of another Windows user so it can connect to remote TFS with different credentials.
I'm running the SQL Server Management Studio as different user this way so I can manage remote SQL servers from different Windows domains.
PS: I tried to run Visual Studio 2015 Update 3 on Windows 10 version 1607 as different Windows account (standard user account without admin rights) and I got the same warning about the admin rights.
I have a tried solution which works for me which is I just make the run-as user account to the local administrators group of the computer you are running it from.

Visual Studio 2005 Output file requires Administrative Privileges

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?

How to avoid necessity of Admin. privileges for Visual Studio with IIS or COM Interop?

When Visual Studio is run without admin. privileges and
I am registering .dll for COM interop the error message is:
Cannot register assembly "myassembly.dll" - access denied.
Please make sure you're running the application as administrator.
Access to the registry key 'HKEY_CLASSES_ROOT\' is denied.
I am running a web application on IIS the error message is:
The Web Application Project PSW is configured to use IIS.
To access local IIS Web sites, you must run Visual Studio
in the context of an administrator account.
I have set Visual Studio run as Administarator to avoid these errors. But UAC message annoys me (but I do not want to switch UAC off).
Is there a way to run Visual Studio normally and use COM Interop or IIS? I mean e.g. some access rights to registry or IIS or set regasm to run as admin.
UAC requires an application to split itself into standard user friendly parts, and admin only parts, and then you can request elevation only when admin only parts are needed (elevation on the fly).
However, the current Visual Studio releases, 2008, 2010, even 11 Beta are still monolithic (like a monolithic kernel, http://en.wikipedia.org/wiki/Monolithic_kernel). So it is impossible right now to achieve what you want, and you have to get used to what it is.
Some access rights to registry or IIS won't help, as you obviously considered too little about what Visual Studio is :) It is a much larger system relying on too many underlying bits.

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)

Resources