views:

1792

answers:

5

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.

A: 

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.

Armitage
How does the group policy need to be changed to allow this?
VS Installer
A: 

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 is a Windows app, but I'm registering with COM interop, which needs the admin rights.
VS Installer
I believe you can turn off the auto-registration for COM components in the project settings. Register the component manually once, and let the IDE just compile the binary without registering it.You will need to re-register the component if you change the interface, obviously.. But it doesn't have to be done every single compile/debug.
+1  A: 

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.

ZeroCool
This is probably the best solution right now. Have the students work on projects in a virtualized environment with admin rights, and then blow it away when they're done.
VS Installer
A: 

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

Preet Sangha
It does need to be visible for COM interop, so the attribute needs to be true.
VS Installer
A: 

All my XP virtuals have VS2005 installed (most also have VS2008). Checking the vista virtual with VS2008 and missing VS2005, there is a Debugger User group, but no VS Developers group. I suspect that the students are in some group, probably called "Students", so you may try adding that group to the Debugger User group and recompiling.

Reading the comments on the group properties for Debugger Users:

Debugger Users are non administrators who are allowed to use Visual Studio to debug processes, both locally

Tangurena
I created a new local user account without Admin rights and added them to the Debugger Users group. I logged in as that account, and I get the same error when I try to build or debug. It seems that VS2008 doesn't use this group anymore.
VS Installer
It's for remote debugging, which we don't use.
VS Installer