appdomain

Prevent IIS from reusing worker processes for separate ASP.Net AppDomains

When IIS restarts an ASP.Net (2.0) web application, it can either: Recycle the AppDomain: Unload the AppDomain and load a new AppDomain on the same process (e.g. when HttpRuntime.UnloadAppDomain() is called, when web.config is changed). Recycle the process: unload the AppDomain and load a new one on a new process (e.g. when invoking Re...

Child form looses focus on first click to parent form. How to fix this?

Im writing a new plugin based app. This loads assemblies in their own app domains and displays the specified main forms within each via Application.Run(pluginForm). I set the main form in the loader app as the parent of each pluginForm before calling Application.Run(pluginForm) inside the app domain. Hence when the pluginForm shows it al...

Application Domain in ASP.NET

Hello Experts, I am beginner.I want to study about Application Domain in ASP.NET. Can anyone explain what is it or give me some good link where I can study for it. Thanks in advance. ...

know when a new thread was created in the AppDomain your application is running after?

hi, i would like to know if there is anyway to get an event (or something other) that tells you when a new thread was created on your appdomain (C# application)? the basic idea is that when a new thread is created i need to "initialize" the thread with some settings. i do not want to go all over my code and do that, as well as i don'...

how to call a method of a class from another appDomain

hi, my application want to call a method of a class that is from another AppDomain. AppDomain env = AppDomain.CreateDomain( "test", null, new AppDomainSetup() { ApplicationName = "test" } ); Assembly a = Assembly.LoadFrom("d:\\testenv1\\test2.dll"); //env.AssemblyR...

How to reload default AppDomain in which Silverlight app is running inside browser?

Inside my Silverlight app, i use reflection to load an assembly. While the app is running, the version and content of that assembly can change. I know the moment, when it changes, now I want to trigger the complete reload of the app, so that assembly is reloaded too with the new version. How to do that? ...

AppDomain isolation

EDIT seems my original post below might have been a bit long. Simply said, can I spawn some AppDomains and ensure that they cannot communicate with one another in any way? There is a competitive robotic soccer simulation league called RoboCup 3D. One of the fundamental rules is that all communication between agents be conducted thro...

Isolation in a Multi-tenant ASP .NET Application

I'm building a multi-tenant ASP .NET application. Given that each tenant can configure their application dynamically (which may involve dynamic custom assemblies being loaded into memory), I need a means of isolating each tenant. I'd prefer not to create a new Web Application per tenant for maintenance reasons. I've was considering us...

Can I prevent an uncaught exception in another AppDomain from shutting down the application ?

Hello, I'm having trouble with a misbehaved library that throws an exception in a finalizer, which of course crashes the application. To avoid this, I tried loading the library in its own AppDomain, but the exception still bubbles to the surface and crashes the application. As documented on MSDN, registering to AppDomain.UnhandledExce...

Excel invokes .NET automation server from two different AppDomains?

I have an Excel plug-in (written in C#) with a static variable that is at the heart of a singleton data cache: static DataCache _instance; This is accessed via three different code paths: Event handlers on a VSTO ribbon-bar initialize the instance, and also read it for display in helper dialogs An RTD server (a class that is declare...

Garbage collecting objects crossing AppDomain boundary

Hi, When you pass an object that inherits from MarshalByRefObject to a different AppDomain, won't GC.Collect() induced by the AppDomain that created it collect the object, provided that the object is not rooted in either AppDomain by the time GC.Collect() called? [When I say not rooted I mean no developer written code access it anymore...

Is it possible to change the value of a string property within a .NET AppDomain from another seperate .NET AppDomian.

Hi, Is it possible to change the value of a public property (type string) of a class within a given .NET AppDomain from another separate .NET AppDomain assuming both AppDomain's are running in the same process. The other important assumption is that the code running in the AppDomain that contains the property can not be modified .. ie ...

Porting a security sandbox from .NET 2.0 to .NET 4.0

I have working .NET 2.0 addin that takes an AppDomain created by an external application and applies user-defined security policy (PolicyLevel) by using AppDomain.SetAppDomainPolicy() method. However, this method is obsolete in .NET 4.0 and fails at runtime. Here is a sample code:   AppDomain domain = ExternalApplication.GetAppDomain...

Multiple Global.asax files per web application project

I have existing web application project in which i need to add new subdirectory. In this subdirectory i need to add WCF service. Question is: Can i use different AppDomain then services from root directory? Also, can i add new global.asax just for this subdirectory? ...

Shutdown an AppDomain and all the AppDomains it created

I want to run a third party library (XSP in this instance) inside an app domain so I can shut it down and otherwise control its behavior. The basic process of: var child = AppDomain.CreateDomain(...) ... AppDomain.Unload(child) Doesn't work when the child app domain creates an app domain itself. When I shut down 'child', any app dom...

the default search base directory is not appDomain.BaseDirectory?

hi, i created a appDomain in my application which base directory is different to my application directory, but it is under the application. i loaded an assembly in the created domain and create object instance from that domain. then i try to execute the method of the object. but i observe an odd behavior. public class Class1 : Mars...

Executing another EXE under the same process of the calling EXE

I have one EXE (built in .Net) running on windows. When it runs, it'd get another EXE from server and execute under that same process. Using Process.Start I can execute the server EXE after dowloading but that'd start a new process with an extra step of downloading the EXE residing on the server. But I wanted a better solution. ...

WCF service, APP Domains and web sites

Hi I have many WCF services (SVC files), and I want to host them in IIS. I was wondering: Is it better to create each one on its own web site? or have them all together live on the same web site? What is the difference? I read that each service will have its own APP domain? Is there any articles that describe relation between WCF service...

Is it possible to have same app running in multiple application domains in parallel?

Let's say I have a windows service called "MyService" and an executable called "MyEXE" Is it possible (from within "MyService") to start several instances of "MyEXE" running in seperate application domains in parallel? I would apprecaiate if some one can also provide a small sample using .net. ...

.NET proxy/loader application architecture

I want to launch a WPF App, in a 2nd AppDomain, from a 'loader' class. If the WPF App times itself out, I want it to fire an event back to the loader class and the loader class will Unload() the the 2nd AppDomain and show a login screen. If the user logs back in, the same process will repeat. I have this working to a degree by : Loa...