Re: Passing Data Between Assemblies

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If the assemblies are in the same process (appdomain) then you can could
have a private static variable on a class and this can then be assigned at
runtime and shared between the assemblies via a class property.

If you need more information on static keyword in .Net check out:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfStaticPG.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfCSharpKeywords_PG.asp


--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.

"Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ufLfysQQFHA.3384@xxxxxxxxxxxxxxxxxxxxxxx
> I have 2 assemblies (for example). Assembly A references assembly B. If
I
> have a value in assembly A that I want to be used in assembly B, how can I
> store it so that assembly B can access it without actually "passing" the
> value to assembly B?
>
> I've seen the Threading.Thread.CurrentThread.SetNamedDataSlot method and
was
> wondering if that could be "safely" used to store information that would
be
> passed normally to just about every public method in my class (such as a
> connection string).
>
> Reason why I am not storing the Connection String inside the App.config is
> it is automatically generated based on user-input. So, I would hate to
have
> to pass this information into the business logic layer and then into the
> data access layer every time I want to access the database. I do not want
> to store this information on disk or registry because it may contain
> passwords which we do not want stored anywhere else but memory...
>
> Look, I'm babbling! Anywho, thanks for the help y'all :)
>
> Mythran
>


.



Relevant Pages

  • Re: Persistence
    ... Why do you think OODB never succeeded? ... flexible way rather than complex assemblies, ... can use the same data store to support alternate assemblies, ... objects implemented in a programming language to XML documents ...
    (comp.object)
  • Re: OleDb Connection to XML File
    ... This Job object could have a collection ... or writting Jobs as assemblies that the executing assembly dynamically loads ... connect to an XML file with OLE DB. ... would be best to store it in a database-like storage area. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to create a new object.
    ... If I store the fullName instead of Type itself it worked fine. ... Will loading all the assemblies before trying to create the object cause any ... "James Curran" wrote: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Method info discovery using Reflection, variable argument list
    ... >> I'm developing a console app that loads dll assemblies at run time. ... spec then i store the method name. ... I will also store the ParamTypes array ...
    (microsoft.public.dotnet.languages.csharp)
  • Passing Data Between Assemblies
    ... I have 2 assemblies. ... I've seen the Threading.Thread.CurrentThread.SetNamedDataSlot method and was wondering if that could be "safely" used to store information that would be passed normally to just about every public method in my class. ... Reason why I am not storing the Connection String inside the App.config is it is automatically generated based on user-input. ... I would hate to have to pass this information into the business logic layer and then into the data access layer every time I want to access the database. ...
    (microsoft.public.dotnet.languages.csharp)