Hi guys,
I'm trying to create my first real VB.NET project, a managed component, and
I seem to be having some trouble. I'm running this on my own laptop, where I
am local admin. It seems like it's a matter of permissions (see cmd message
below). I'm running VS Team Suite 2005 v8.0.50727.867, on Vista Ultimate,
and I've set the VS shortcut to [Run as Administrator].
The project is very simple; a couple of public functions, and that's all. I
inherited ServicedComponent, built the project, created the key pair (sn -k
pdb.snk), added the Assembly attribute to AssemblyInfo.vb <Assembly:
AssemblyKeyFile("..\..\..\pdb.snk")> , and built the project again. Then I
tried to register the component with COM (regsvcs ChatterBox.dll), and
received the following messages:
<snip>
Microsoft (R) .NET Framework Services Installation Utility Version
2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
The following installation error occurred:
1: You must have administrative credentials to perform this task. Contact
your system administrator for assistance.
2: Failed to register assembly 'ChatterBox, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=77c3f554ffee0bb9'.
3: Access to the registry key 'HKEY_CLASSES_ROOT\ChatterBox.ChatterBox' is
denied.
</snip>
Sorry if I haven't provided enough information, but if it IS a permissions
problem, as it seems to be, how can I resolve this issue?
Thanks,
Graham
EagleRed@HighFlyingBirds.com - 28 Mar 2008 22:28 GMT
You need to use some COM interoperability mechanism. Check the topic,
"Exposing .NET Framework Components to COM" in the VS documentation. I have
done this using a COM Callable Wrapper. There is another mechanism called,
Runtime Callable Wrapper. You might look at these topics in the
documentation.
> Hi guys,
>
[quoted text clipped - 30 lines]
> Thanks,
> Graham
Graham R Seach - 31 Mar 2008 02:01 GMT
Thanks but I'm already using regsvcs, so I don't have to even think about a
CCW. It turns out that although VS was running in the Admin context, the
command prompt was not. Once I sent it to [Run as Administrator], the
problem went away. After setting the ClassInterface attribute, I can see the
library from my app and all's well with the world.
- Graham
> You need to use some COM interoperability mechanism. Check the topic,
> "Exposing .NET Framework Components to COM" in the VS documentation. I
[quoted text clipped - 46 lines]
>> Thanks,
>> Graham