Hello everyone,
I am debugging and learning MSDN C# COM server sample. http://msdn2.microsoft.com/en-us/lib...38(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will
use mscoree.dll as the entry point. But I can not see anything related to the
real codebase dll (CSharpServer.dll), which contains the real implementation
of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in
CSharpServer.dll? -
REGEDIT4
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
-
@="{C6659361-1625-4746-931C-36014B146679}"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
-
@="mscoree.dll"
-
"ThreadingModel"="Both"
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented
-
Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
-
thanks in advance,
George 4 2338
Hi,
I was working lately on COM implementation in .Net and found out that
running regasm with tlb option registers as well the full path to tlb and
the directory where the dll (assembly). is placed.
When you look into registry, in the TypeLib subkey for registered classes
you have the Guid of the key that contains the information.
This is located in: \\HKCR\TypeLib\[YourGuid]
I don't know why the generated registry information does not contain this
bit.
Some good articles on .Net COM development can be found here: http://www.codeproject.com/useritems...rsInDotNet.asp http://www.codeproject.com/dotnet/nettocom.asp
Best regards,
Cezary Nolewajka
Consultant | Microsoft Services | Microsoft | Poland
"George" <Ge****@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
Hello everyone,
I am debugging and learning MSDN C# COM server sample.
http://msdn2.microsoft.com/en-us/lib...38(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will
use mscoree.dll as the entry point. But I can not see anything related to
the
real codebase dll (CSharpServer.dll), which contains the real
implementation
of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in
CSharpServer.dll?
-
REGEDIT4
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
-
@="{C6659361-1625-4746-931C-36014B146679}"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
-
@="mscoree.dll"
-
"ThreadingModel"="Both"
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented
-
Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
-
thanks in advance,
George
"George" <Ge****@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
Hello everyone,
I am debugging and learning MSDN C# COM server sample.
http://msdn2.microsoft.com/en-us/lib...38(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will
use mscoree.dll as the entry point. But I can not see anything related to
the
real codebase dll (CSharpServer.dll), which contains the real
implementation
of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in
CSharpServer.dll?
This line:
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null"
is the reference data used by mscoree to load managed assemblies.
> -
REGEDIT4
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
-
@="{C6659361-1625-4746-931C-36014B146679}"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
-
@="mscoree.dll"
-
"ThreadingModel"="Both"
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
-
@="CSharpServer.InterfaceImplementation"
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented
-
Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
-
thanks in advance,
George
Hi Ben,
How do you think from the following line,
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null"
mscoree.dll will find the actual codebase -- CSharpServer.dll? Why it could
find this CSharpServer.dll, other than some other dll?
(I have this question since from the registry line you quoted, there is no
information about CSharpServer.dll).
regards,
George
"Ben Voigt [C++ MVP]" wrote:
>
"George" <Ge****@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
Hello everyone,
I am debugging and learning MSDN C# COM server sample. http://msdn2.microsoft.com/en-us/lib...38(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will
use mscoree.dll as the entry point. But I can not see anything related to
the
real codebase dll (CSharpServer.dll), which contains the real
implementation
of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in
CSharpServer.dll?
This line:
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null"
is the reference data used by mscoree to load managed assemblies. -
REGEDIT4
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
-
@="{C6659361-1625-4746-931C-36014B146679}"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
-
@="mscoree.dll"
-
"ThreadingModel"="Both"
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented
-
Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
-
thanks in advance,
George
Thanks Cezary!
I have tested that you are correct! We have to use /tlb option.
I am writing C# COM server (managed code). Since there is no QueryInterface,
DllGetClassObject like in C++ native code, I am wondering how to know which
coclass is initialized and which method is invoking by client?
I have such question is because I only develop COM server, and there are
some dll level error (dll no longer available, something like this), so I
think COM client may use some coclass/methods which my COM server does not
support. But I do not have COM client source codes, so I am wondering how to
get the information (which coclass/method client is using).
thanks in advance,
George
"Cezary Nolewajka" wrote:
Hi,
I was working lately on COM implementation in .Net and found out that
running regasm with tlb option registers as well the full path to tlb and
the directory where the dll (assembly). is placed.
When you look into registry, in the TypeLib subkey for registered classes
you have the Guid of the key that contains the information.
This is located in: \\HKCR\TypeLib\[YourGuid]
I don't know why the generated registry information does not contain this
bit.
Some good articles on .Net COM development can be found here:
http://www.codeproject.com/useritems...rsInDotNet.asp http://www.codeproject.com/dotnet/nettocom.asp
Best regards,
Cezary Nolewajka
Consultant | Microsoft Services | Microsoft | Poland
"George" <Ge****@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
Hello everyone,
I am debugging and learning MSDN C# COM server sample. http://msdn2.microsoft.com/en-us/lib...38(vs.71).aspx
I am using Regasm to generate Windows Registry scripts, here it is,
I can understand that for C# COM Server, since it is managed code, it will
use mscoree.dll as the entry point. But I can not see anything related to
the
real codebase dll (CSharpServer.dll), which contains the real
implementation
of coclass and interface definition.
I am wondering how mscoree.dll find and invoke real implementation in
CSharpServer.dll? -
REGEDIT4
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]
-
@="{C6659361-1625-4746-931C-36014B146679}"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]
-
@="mscoree.dll"
-
"ThreadingModel"="Both"
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]
-
"Class"="CSharpServer.InterfaceImplementation"
-
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral,
-
PublicKeyToken=null"
-
"RuntimeVersion"="v2.0.50727"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]
-
@="CSharpServer.InterfaceImplementation"
-
-
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented
-
Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
-
thanks in advance,
George
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kevin Flanagan |
last post by:
This can be reproduced with VS.NET as follows. Create a new ATL
project with default wizard settings (dll, attributed). To the
'module' attribute, add a specifier 'version = "1.10" ' alongside the...
|
by: Namratha Shah \(Nasha\) |
last post by:
Hey Guys,
TlbExp.exe and Regasm.exe tools aid us in exporting assembly information to
a type library so that non .Net Applications or unmanaged code use this type
library information to call...
|
by: Id L |
last post by:
hi,
i want to use gacutil.exe and regasm.exe but i don't want to install
"all" .net framework SDK
do you know if i can install only these 2 methods?
or maybe i can use them without installing...
|
by: Sara |
last post by:
I have written a class and tried to register it using regasm.exe using
regasm myTest.dll /tlb:myTest.tlb
tlb file got generated and i got dll registered successfully msg.
but when i go and...
|
by: Kenneth Jonsson |
last post by:
I have an COM server in an assembly. When it is deployed on a target computer
it needs to be registred with RegAsm. I created a custom action in the deploy
project, starting RegAsm with the...
|
by: rbanerji |
last post by:
I have a COM object built in C#. Its a an IE deskband. It implements
the following method:
public static void Register( Type t )
Which gets called when regasm is used and it makes teh...
|
by: auad |
last post by:
hi,
I would like to register a dll (regasm) during the execution of my
setup using custom actions.
I don't know where to place the parameters for regasm in the custom
action.
I tried using "...
|
by: gopal |
last post by:
I installed MS DevEnv 2003 with framework 1.1.I developed a small
application which looks out for the assembly vcersion of a .net DLL or
EXE via code. But i have a problme durng the registration...
|
by: xamman |
last post by:
hi there, i am trying to use a .NET assembly from a Cscript.exe .vbs
(i.e. from COM)
and could not get my .vbs to use my .net dll (gives a 'file not found
error')
unless i used the /codebase...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |