Re: Outprocess library in .NET

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: David Browne (meat_at_hotmail.com)
Date: 03/18/04


Date: Thu, 18 Mar 2004 09:29:06 -0600


>I'm using MSMQ triggers to launch COM object written in C#. Unfortunately,
there is a need to >have some .config file attached to my COM, so it could
read necessary settings within. As far as >I understand my class library
(written in c# and registered as COM object) is an inprocess COM >running
inside the caller process and have no possibility to find it's config file
(moreover, >.NET studio does not allow attaching .config files to class
libraries). How can I handle this?

Your C# dll is an Assembly.
If your assembly is not shadow copied, and it is not in the GAC, you can put
your config file in the same directory as your dll and get that location
with

string path
=System.IO.Directory.GetParent(System.Reflection.Assembly.GetExecutingAssemb
ly().Location).FullName;

You may need to register your assembly with the /codebase option for it to
be found by COM clients outside the GAC.

 regasm MyLibrary.dll /tlb:MyLibrary.tlb /codebase

David



Relevant Pages

  • Re: Outprocess library in .NET
    ... > inside the caller process and have no possibility to find it's config file ... > your config file in the same directory as your dll and get that location ... > be found by COM clients outside the GAC. ...
    (microsoft.public.dotnet.framework)
  • Re: Remoting Help Required
    ... .config file, register it as a well known type and as long as it's in the ... instances of your app out there pointing to a separate instance of that dll. ... > Now I have a request to run multiple versions of the reports on the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: GAC and configfile
    ... A Dll cant have its own config file from which values are picked at runtime. ... When you register assemblies in the GAC, they are actually stored in their ...
    (microsoft.public.dotnet.framework)
  • Assembly in the GAC, using Enterprise Library...how to access .con
    ... If you had a DLL that you installed to the GAC that uses the Enterprise ... primary .config file? ... when you have to install your DLL into the GAC, ...
    (microsoft.public.dotnet.framework)
  • Re: Configuration Error using Forms Authentication
    ... inherits the dbpractice config which in turn inherits from Machine.config. ... Since the register config inherits the root virtual directory, ... config file where the people can login. ...
    (microsoft.public.dotnet.framework.aspnet.security)