Groups | Blog | Home
all groups > dotnet interop > august 2003 >

dotnet interop : Can't call .NET to .NET through COM+


steve
8/21/2003 7:30:09 PM
I have .NET assemblies that are registred in COM+ as
Server applications (own process). I can create and call
them from C++ code with no problem.

If I try to create them from .NET code, the COM+
application starts and the .NET assembly is loaded in the
DLLHOST.EXE process space, but I get an error message:

"File or assembly name [assembly name], or one of its
dependencies, was not found."

This is the code:
Type type = Type.GetTypeFromProgID(progID); // Succeeds
object obj = Activator.CreateInstance(type); // Fails

If I change the COM+ Activation setting from Server to
Library, the above code works.

What's going on here?
v-yiy NO[at]SPAM online.microsoft.com
8/22/2003 3:18:57 AM
Hi steve,
You may fist try to export the typelib and use it as COM to see if it
has problems. If it has no problem , I think you should check if you
registered your .NET COM+ component correctly. You may refer to the
following link for more information,

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconregistering
servicedcomponents.htm
please let me know, if you still have problems on that, thanks!


Kind regards,

Ying-Shen Yu [MSFT]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "steve" <steve_donnelly@countrywide.com>
| Sender: "steve" <steve_donnelly@countrywide.com>
| Subject: Can't call .NET to .NET through COM+
| Date: Thu, 21 Aug 2003 19:30:09 -0700
| Lines: 20
| Message-ID: <001e01c36855$4eaa0520$a001280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNoVU6n//2D6pojQKmptxfJCNpAXw==
| Newsgroups: microsoft.public.dotnet.framework.interop
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.interop:18151
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.interop
|
| I have .NET assemblies that are registred in COM+ as
| Server applications (own process). I can create and call
| them from C++ code with no problem.
|
| If I try to create them from .NET code, the COM+
| application starts and the .NET assembly is loaded in the
| DLLHOST.EXE process space, but I get an error message:
|
| "File or assembly name [assembly name], or one of its
| dependencies, was not found."
|
| This is the code:
| Type type = Type.GetTypeFromProgID(progID); // Succeeds
| object obj = Activator.CreateInstance(type); // Fails
|
| If I change the COM+ Activation setting from Server to
| Library, the above code works.
|
| What's going on here?
|
|
AddThis Social Bookmark Button