Cannot build assembly with COM interop, VS2005 + Vista beta 2

When I build an assembly using msbuild that has COM Interop, msbuild fails in the UnManagedRegistration target.

c:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2720,9): error MSB3216: Cannot register assembly <assemble name> - access denied. Access to the registry key 'HKEY_CLASSES_ROOT\<com class name>' is denied.

I am running msbuild using an user with Administrator permissions. The OS is still set to request the user for elevated permissions.

[514 byte] By [RobertSlaney] at [2007-12-24]
# 1

u need actually to start a cmd in Vista using 'run as' administrator, before this will happen. Its not enough that your user has adm. priviledges.

alschy at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 2
Thank you! I tried this method. The programme is working now. But how to get this priviledge in the source code, so it can be ran as adminitrator automaticly without opening an administrative cmd to run it.
SS7E1983 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 3

sounds good. I'm assuming you mean modifying the short cut to include the 'run as'

many thanks

Chris
www.futurepinball.com

cleathley at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 4
alschy wrote:

u need actually to start a cmd in Vista using 'run as' administrator, before this will happen. Its not enough that your user has adm. priviledges.

I'm fully aware of the ability to elevate the priviledges by running as an Admin, but this does not help me automate builds that require COM interop, especially if they are un-attended like CruiseControl.NET, or scripted using nAnt.

Forcing a developer to run the shortcut as an Admin everytime will just mean that we turn off that "feature", making the system less secure.

RobertSlaney at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified