Shared DLL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Osvaldo Bisignano

    #1

    Shared DLL

    Program1.exe and Program2.exe reference Library.dll, which only contains a
    class with static methods and properties.

    Modifying a value of Library.dll from Program1.exe, will change when I read
    that value from Program2.exe?
    If not... must I use remoting to achieve this?
    Can I use Diagnostics.Pro cesses?
    Suggestions?

    Thanks everybody



  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Shared DLL

    Osvaldo,

    The values in Program1 and Program2 will be different if accessing the
    same dll. Static values are limited to the app domain that the assembly is
    loaded in, and the two executables are definitely running in different
    application domains.

    Like you said, you can get around this using remoting, and use a shared
    instance. You might also want to consider using a component derived from
    ServicedCompone nt. You can have a pooled component with a min pool size of
    one, and a max pool size of one, effectively creating a singleton.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Osvaldo Bisignano" <valdonanoNOSPA M@yahoo.com.ar> wrote in message
    news:eDHv67knDH A.3700@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Program1.exe and Program2.exe reference Library.dll, which only contains a
    > class with static methods and properties.
    >
    > Modifying a value of Library.dll from Program1.exe, will change when I[/color]
    read[color=blue]
    > that value from Program2.exe?
    > If not... must I use remoting to achieve this?
    > Can I use Diagnostics.Pro cesses?
    > Suggestions?
    >
    > Thanks everybody
    >
    >
    >[/color]


    Comment

    • Osvaldo Bisignano

      #3
      Re: Shared DLL

      That's great Nicholas. Thank you. I wonder what are those Application
      Domains exactly, i'll look for the documentation but if you can give me some
      introduction about them and how can i load differents assemblies into a same
      AppDom.
      The idea is to get around the "modules" in different exe's working together
      scenario.




      "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> escribió
      en el mensaje news:eVGJ9ClnDH A.1672@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Osvaldo,
      >
      > The values in Program1 and Program2 will be different if accessing the
      > same dll. Static values are limited to the app domain that the assembly[/color]
      is[color=blue]
      > loaded in, and the two executables are definitely running in different
      > application domains.
      >
      > Like you said, you can get around this using remoting, and use a[/color]
      shared[color=blue]
      > instance. You might also want to consider using a component derived from
      > ServicedCompone nt. You can have a pooled component with a min pool size[/color]
      of[color=blue]
      > one, and a max pool size of one, effectively creating a singleton.
      >
      > Hope this helps.
      >
      >
      > --
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "Osvaldo Bisignano" <valdonanoNOSPA M@yahoo.com.ar> wrote in message
      > news:eDHv67knDH A.3700@TK2MSFTN GP11.phx.gbl...[color=green]
      > > Program1.exe and Program2.exe reference Library.dll, which only contains[/color][/color]
      a[color=blue][color=green]
      > > class with static methods and properties.
      > >
      > > Modifying a value of Library.dll from Program1.exe, will change when I[/color]
      > read[color=green]
      > > that value from Program2.exe?
      > > If not... must I use remoting to achieve this?
      > > Can I use Diagnostics.Pro cesses?
      > > Suggestions?
      > >
      > > Thanks everybody
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...