Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

.NET and COM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kanaille11@googlemail.com - 03 Sep 2007 10:05 GMT
Hi,
at the moment we're experiencing path issues. From what I know, a .NET-
assembly is looked up
1) in the GAC
2) in the EXE's directory
3) if specified in the app.config-file, in a subdirectory or in an
arbitrary location

What I need to know is this:
we have a COM-component (written in .NET) which references a .NET-
assembly with some business logic. Let's say these DLLs are in d:
\TheProject\bin\debug. The COM-dll is registered with
regasm SomeCOM.dll /codebase

A test application is under c:\program files\TestApp and opens that
COM-component. Although the .NET-assembly doesn't meet any of the 3
criteria, it can be loaded. Why is that? Where is that specified? Is
this always the case when using COM-components?

mfg Steven
theinvisibleGhost - 03 Sep 2007 11:03 GMT
On 3 Sep, 10:05, kanaill...@googlemail.com wrote:
> Hi,
> at the moment we're experiencing path issues. From what I know, a .NET-
[quoted text clipped - 16 lines]
>
> mfg Steven

I think you'll find performing a regasm /codebase will register
the DLL in the registry, including the location of the DLL.
Presumably the other part of your application is requesting the COM
interface from
the registry and the registry shows where the DLL Is located.
kanaille11@googlemail.com - 03 Sep 2007 12:50 GMT
> I think you'll find performing a regasm /codebase will register
> the DLL in the registry, including the location of the DLL.
> Presumably the other part of your application is requesting the COM
> interface from
> the registry and the registry shows where the DLL Is located.

That's right, that's the COM way of locating DLLs. But why is the
referenced .NET-assembly found?
It should be loaded with .NET's standard mechanism. As it seems to me
the codebase is enhanced
when the COM-module is loaded. If that's true, this should be
documented somewhere - but I can't find
it :-(
theinvisibleGhost - 03 Sep 2007 13:36 GMT
> That's right, that's the COM way of locating DLLs. But why is the
> referenced .NET-assembly found?
[quoted text clipped - 3 lines]
> documented somewhere - but I can't find
> it :-(

Am I getting this right
Test Application references a COM Interface
You've got a .NET assembly wrapped in a COM wrapper,
which in turn references a .NET assembly?

If so I'd expect the wrapped .NET code to find any referenced DLL's in
the same directory as the wrapped .NET assembly location, unless told
otherwise.

I've got some code which does this, for a plugin for an media player
written with MFC.
kanaille11@googlemail.com - 03 Sep 2007 15:43 GMT
> Am I getting this right
> Test Application references a COM Interface
[quoted text clipped - 7 lines]
> I've got some code which does this, for a plugin for an media player
> written with MFC.

Yes, that's exactly our environment.
But you know what: I just found the bug that caused me headaches for
days. It didn't had to do with
assembly loading...I wanted to make sure with this post that assembly
loading this way is 100% legal
and not the reason for our problems.

So thanks for your answers,

mfg Steven

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.