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. C#
  4. AppDomain

AppDomain

Scheduled Pinned Locked Moved C#
question
8 Posts 6 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.
  • H Offline
    H Offline
    humayunlalzad
    wrote on last edited by
    #1

    Guys When I run two instances of notepad, while task manager is running, I see that the number of processes increases with each instance of notepad or any exe. It means they are running in their own process and appdomain respectively. How can I make two programs run on different appdomains but the same process.

    M G H 3 Replies Last reply
    0
    • H humayunlalzad

      Guys When I run two instances of notepad, while task manager is running, I see that the number of processes increases with each instance of notepad or any exe. It means they are running in their own process and appdomain respectively. How can I make two programs run on different appdomains but the same process.

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      You cant. Two programs can not run on one process else it would be the same program, no?

      Life goes very fast. Tomorrow, today is already yesterday.

      L H 2 Replies Last reply
      0
      • M musefan

        You cant. Two programs can not run on one process else it would be the same program, no?

        Life goes very fast. Tomorrow, today is already yesterday.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Well, does this got to do anything with .NET then?! :omg:

        1 Reply Last reply
        0
        • M musefan

          You cant. Two programs can not run on one process else it would be the same program, no?

          Life goes very fast. Tomorrow, today is already yesterday.

          H Offline
          H Offline
          humayunlalzad
          wrote on last edited by
          #4

          I still have to come to grip with appdomains. So could you tell me, under what circumstances would we want to have two appdomains in the same process.

          L K 2 Replies Last reply
          0
          • H humayunlalzad

            I still have to come to grip with appdomains. So could you tell me, under what circumstances would we want to have two appdomains in the same process.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi, you can dynamically load DLL files into the current or a new app domain, but you can't unload DLL files; you can however unload an app domain. So for add-on software (especially if you don't fully trust it) loading it in another app domain makes a lot of sense. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


            1 Reply Last reply
            0
            • H humayunlalzad

              Guys When I run two instances of notepad, while task manager is running, I see that the number of processes increases with each instance of notepad or any exe. It means they are running in their own process and appdomain respectively. How can I make two programs run on different appdomains but the same process.

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

              You can load managed executable in memory and run it. You will have one process but when you exit it, the loaded executable will exit too.

              Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

              1 Reply Last reply
              0
              • H humayunlalzad

                I still have to come to grip with appdomains. So could you tell me, under what circumstances would we want to have two appdomains in the same process.

                K Offline
                K Offline
                Kythen
                wrote on last edited by
                #7

                Here's a real-world example: Unit testing software, such as NUnit, will load your unit test assemblies into a separate AppDomain for safety and security reasons. Using additional AppDomains is also the only way to unload an assembly from a .NET process. Say you have an app that uses plugins. In the unmanaged world you can just use LoadLibrary and FreeLibrary calls to load and unload a plugin dll. In .NET you would have to load the plugin dll into a separate AppDomain, then get rid of that AppDomain to unload the plugin.

                1 Reply Last reply
                0
                • H humayunlalzad

                  Guys When I run two instances of notepad, while task manager is running, I see that the number of processes increases with each instance of notepad or any exe. It means they are running in their own process and appdomain respectively. How can I make two programs run on different appdomains but the same process.

                  H Offline
                  H Offline
                  humayunlalzad
                  wrote on last edited by
                  #8

                  Thanx Guys Finally I know what appdomain is all about.

                  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