Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How to share the static variable across the application instances?

How to share the static variable across the application instances?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpasp-netcomtutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nagaraj Muthuchamy
    wrote on last edited by
    #1

    I am writing a static class with four static members using C#.NET. This class is being used in the application. I want to make this class common for diffrent instances of the application. Static class instances must not be created seperately for each instance of the application. Application(Asp.Net) variables cannot be used here as it is Windows Application. Thanks, Nagaraj

    My Project

    S G 2 Replies Last reply
    0
    • N Nagaraj Muthuchamy

      I am writing a static class with four static members using C#.NET. This class is being used in the application. I want to make this class common for diffrent instances of the application. Static class instances must not be created seperately for each instance of the application. Application(Asp.Net) variables cannot be used here as it is Windows Application. Thanks, Nagaraj

      My Project

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      You can't. The objects are only accessible from within the app domain. What is it you are trying to do? If you are trying to pass data between app domains you could consider remoting[^], WCF[^], or this article[^]

      Simon

      G 1 Reply Last reply
      0
      • S Simon P Stevens

        You can't. The objects are only accessible from within the app domain. What is it you are trying to do? If you are trying to pass data between app domains you could consider remoting[^], WCF[^], or this article[^]

        Simon

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        There is IPC[^] too :)

        Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion

        1 Reply Last reply
        0
        • N Nagaraj Muthuchamy

          I am writing a static class with four static members using C#.NET. This class is being used in the application. I want to make this class common for diffrent instances of the application. Static class instances must not be created seperately for each instance of the application. Application(Asp.Net) variables cannot be used here as it is Windows Application. Thanks, Nagaraj

          My Project

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          You can use IPC[^] for exchanging data between process. .Net Framework includes classes for IPC.

          Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups