The CLR doesn't need typelibs to load .NET assemblies.
Typelibs are only required by native COM clients.
Willy.
Hi Willy,
Sorry, I forgot to include several key points.
We currently have a C++ app. I want to add to it the ability to host
a CLR, and to load a variety of different .NET assemblies that all
expose the same interface. This C++ app should be able to scan
through a directory and load all the assemblies that have this
interface.
I have seen examples of a C++ app hosting the CLR, and loading an
assembly, but only when the C++ app imports the typelib for the
assembly. I would like to instead load things dynamically and avoid
using a typelib because I don't know before hand what each assembly is
going to be.
Is there such a way to do what I am describing above?
Thanks,
Terry
> The CLR doesn't need typelibs to load .NET assemblies.
> Typelibs are only required by native COM clients.
[quoted text clipped - 19 lines]
> >
> > Terry
Ben Rush - 26 Nov 2003 21:54 GMT
I'm afraid I still don't understand, you are looking for typelibs for .NET
assemblies, but afaik they don't have any. All type information for an
assembly exists in its manifest and metadata. Keep in mind I've never
written a native app to host the CLR, though.
Have a look at http://www.gotdotnet.com/team/clr/about_clr_Hosting.aspx
> Hi Willy,
>
[quoted text clipped - 41 lines]
> > >
> > > Terry
Joel Pobar [MSFT] - 28 Jan 2004 21:26 GMT
Hi,
If you're looking to load types from the unmanaged world based on what
interface they implement, you can possibly start with the unmanaged
metadata API's (IMetaDataImport, IMetaDataAssemblyImport,
IMetaDataDispenser, IMetaDataTables). There's a cool diagram in the "Common
Language Infrastructure Annotated Standard" by Jim Miller, page 324 that
shows the Metadata table layouts. You can extract a types implemented
interface from there.
Personally, I'd probably try changing whatever requirements you have to
allow Reflection to reflect and load the required types from the managed
world. Much much nicer. =)
Thanks
-Joel.
--------------------
>From: tstoneman4@hotmail.com (T Stoneman)
>Newsgroups: microsoft.public.dotnet.framework.clr
[quoted text clipped - 46 lines]
>> >
>> > Terry