appdomain

.Net COM DLL not working from vb6 across appdomains

We have a large vb6 application, and as we need to change/fix things, we are moving sections to .net, targeting the framework 2.0. We have moved a bunch of classes to a .net dll, and they are set up properly to be exposed to com. Here's the problem: MainAppVB6.exe instantiates DOTNET_COM.ComClass. It passes this to a method in a diff...

Is there an AppDomain for every C# program?

Is there an AppDomain for every C# program even if we do not specifically create an AppDomain? Why is it required? I have read about third party assemblies crashing the entire application if we do not load them into separate AppDomain. I didn't get that point well. Can anyone explain this also. ...

How can you run a process on another computer in .net

Let's say I have a windows service called "MyService" and an executable called "MyEXE" located on serveral computers on my network. Is it possible (from within "MyService") to start several instances of "MyEXE" on a diffrent/same computer, have it do some task and return a true/false result to a callback method in "MyService"? Somethin...

When would I use an AppDomain?

I'm fairly new to reflection and I was wonder what I would use a (second) AppDomain for? What practical application would one have in a business application? ...

Generic container for exposing POCO instances to other AppDomains - how does it work?

I'm intrigued by this answer from another SO thread, and I was hoping someone can help me shine some light on the concept. Say I have a primary AppDomain and a bunch of child AppDomains, that are created and initialized by the primary AppDomain. In pseudo code: Primary AppDomain: class Parent { public void InitChildren(IList<Child...

Can I tell the CLR to marshal immutable objects between AppDomains by reference?

When marshaling objects between AppDomains in .NET the CLR will either serialize the object (if it has the Serializable attribute) or it will generate a proxy (if it inherits from MarshalByRef) With strings however the CLR will just pass the reference to the string object into the new AppDomain. The CLR still ensures integrity since .NE...

C# Application Domain Private bin Path Update

Hi, does anyone know if it is possible to change the AppDomain.CurrentDomain.SetupInformation.PrivateBinPath for the current application domain? or does this only affect future appdomain instances.. Thanks. ...

How to keep ASP.NET assemblies in AppDomain alive?

Scenario: I've an n-Tier enterprise ASP.NET application deployed using Web Deployment Projects. All tiers produce independent assemblies that is consumed by the ASP.NET application. Problem: When I run the app. for the first time after deployment it takes lot of time to load dependent assemblies in memory. But once loaded its lighting f...

AppDomain assembly load causes Fatal Execution Engine Error (6B3979C6) (80131506)

We have a type caching system in place to avoid searching all plug-in assemblies for all types each time our application starts up, but when moving from .NET 1.1 to 2.0+, the Event Log records a Fatal Execution Engine Error (6B3979C6) (80131506) on the AppDomain.Load() If and only if 1. the AppDomain is NOT AppDomain.CurrentDomain. 2....

.NET Application domains and ASP.NET

We all know that the .NET architecture introduced the concept of application domains. ASP.NET creates an application domain for each Web application that runs on a Web server. With a process viewer, you will not see the process for individual web applications executing because there's no new process created for them. How can I view the...

How do I detect the application closing?

I'm building a component in a server application that manages connections between my application and an external service. My component detects when the server is unavailable, starts a background thread until the service becomes available, then re-enters a "working" state. My problem is that if the process calling the component exits whi...

static variables of a class used in different AppDomains

I have two executables that reference the same Class Library. In the class library I have a static variable. How can that static variable persists on the two different executables? This is how it looks: public class MyClass { public static string MyVar; } App 1: public class MyApp1 { public void SomeMethod() { ...

WCF Self Hosting Performance

I am in the process of writing an enterprise-level application utilizing WCF and NetTCP services. I chose NetTCP initially out of curiosity, but later determined it to be the best option for me since I can have services that are called that take 5+ hours to return results due to the amount of data crunching involved. The way I currently...

How to reload an assembly for a .NET Application Domain?

We are loading an assembly (a DLL) which reads a configuration file. We need to change the configuration file and then re-load the assembly. We see that after loading the assembly the 2nd time, there is no change in the configuration. Anyone see what is wrong here? We left out the details of reading in the configuration file. AppDomai...

Control AppDomainSetup when activating AddInToken within AddInProcess

In .net, one can create an AddIn within a new AppDomain. The creation of new AppDomains is nothing new, and one can use an AppDomainSetup class to specify all the startup parameters (such as where to find the app.config) of the newly created AppDomain. However, when activating an AddInToken using a new AddInProcess (which specifies that ...

Does App_Code in ASP.Net compile new code to a secondary temp AppDomain?

I am trying to better understand how the App-Code folder operates, and in particular I am curious how new objects that a new class in the App-Code folder are included in the current AppDomain. Is a second, temporary AppDomain created in the same manner as when I compile new objects with the CodeDom? In many ways the capability of movin...

ProcessExit vs DomainUnload

I'm working on a bug where code is not always being executed before an application shuts down. The code was in a handler for the AppDomain.CurrentDomain.DomainUnload event. I found a post by someone with the same problem who received this advice "By the time the DomainUnload event happens for your default app domain, your code has sto...

AppDomain and threading

Basically, from what I've understood of the little I've managed to search up on the internet, threads can pass between AppDomains. Now, I've written the following code: const string ChildAppDomain = "BlahBlah"; static void Main() { if (AppDomain.CurrentDomain.FriendlyName != ChildAppDomain) { bool...

Java AppDomain like abstraction?

I'm curious if there are any Java abstractions that are similar to .Net's AppDomain. In particular, I'm curious because I've found that with our Coldfusion/J2EE server we need to restart it every few days due to a slow memory leak that we haven't been able to easily track down yet. This can wreck our long-running processes and we'd rea...

Minimum-trust AppDomain cross-calling methods in a full trust AppDomain

I have a minimum-trust AppDomain that is calling (across a remoting boundary) methods in a full trust assembly in a full trust AppDomain. However I am getting lots of security exceptions when making these method calls. It would appear that the minimum-trust 'sandbox' is propagating up the stack its minimal security privileges onto the f...