appdomain

What is the minimum Cross AppDomain communication performance penalty?

时光毁灭记忆、已成空白 提交于 2019-11-28 02:33:34
问题 I am trying to minimize the performance penalty of communicating across AppDomains in the same machine. In my toy example, Class A is loaded in AppDomain 1. It creates an AppDomain 2 and loads there an instance of Class 2 (Class 2 inherits from MarshalByRef) getting back a proxy. Then Class 1 calls repeatedly a method on the proxy that returns no values. I get the following results: No AppDomains, both classes are loaded in the same AppDomain and the first calls repetedly the method on the

Communication between AppDomains

喜夏-厌秋 提交于 2019-11-28 01:50:03
问题 We are building an app (WinForms, .NET 3.5) that loads "Plugin" DLLs into a secondary AppDomain. The secondary AppDomain needs to communicate occasionally with the 1st one (more specifically, call or get data from objects that are created in the main AppDomain). I have read most of the material about AppDomains and communication between them. So far, the only easy solution i've seen was inheriting from MarshalByRefObject and passing a TransparentProxy into the 2nd AppDomain, calling methods

Can you modify the web.config and NOT restart the ASP.NET application? [duplicate]

主宰稳场 提交于 2019-11-28 01:07:20
问题 Possible Duplicate: How to prevent an ASP.NET application restarting when the web.config is modified? Was just thinking about uptime. Thanks. 回答1: Yes, you can; see this answer. However, it is not a good idea. Until ASP.Net restarts the AppDomain, it will not look at web.config . If you change web.config , your changes will have no effect until the AppDomain is restarted. 回答2: You can create an external settings file and then reference it in your web.config. You will need to change the

How do I implement .net plugins without using AppDomains?

断了今生、忘了曾经 提交于 2019-11-27 20:19:30
Problem statement: Implement a plug-in system that allows the associated assemblies to be overwritten (avoid file locking). In .Net, specific assemblies may not be unloaded, only entire AppDomains may be unloaded. I'm posting this because when I was trying to solve the problem, every solution made reference to using multiple AppDomains. Multiple AppDomains are very hard to implement correctly, even when architected at the start of a project. Also, AppDomains didn't work for me because I needed to transfer Type across domains as a setting for Speech Server worfklow's InvokeWorkflow activity.

Static Variable Instances and AppDomains, what is happening?

可紊 提交于 2019-11-27 20:06:31
I have public static class A { public static string ConnString; } [Serializable] public class Test{ // Accesing A's field; public string ConnString{get{return A.ConnString;}set{A.ConnString=value;}} } void Main() { A.ConnString = "InitialString"; // I set A.ConnString in the current domain var newDomain = AppDomain.CreateDomain("DomNew"); Test TObj = newDomain.CreateInstanceAndUnwrap(typeof(Test).Assembly.FullName, typeof(Test).FullName) as Test ; TObj.ConnString = "NewDomainString"; // It is supposed to set A.ConnString in the newDomain aka a different instance of A.ConnString // Here it is

“Object has been disconnected or does not exist at the server” exception

我只是一个虾纸丫 提交于 2019-11-27 18:29:00
I need to use cross-appdomain calls in my app, and sometimes I have this RemotingException: Object '/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmkhdinj7g2kpkhc_7.rem' has been disconnected or does not exist at the server. The target object is still alive, I have checked it. UPD I've set breakpoint in the finalizer of the target object, and it never hits. Thus, this object is alive and wasn't GC'ed. That is probably because the local garbage collector at the server side collects the object. You can prevent that by renewing the leasing. You can read more about that in these articles: Managing

Loading/Unloading assembly in different AppDomain

眉间皱痕 提交于 2019-11-27 17:53:17
I need to execute a method in an assembly loaded during runtime. Now I want to unload those loaded assemblies after the method call. I know that I need a new AppDomain so I can unload the libraries. But here, the problem arises. The assemblies going to load are plugins in my plugin framework. They have no entry point at all. All I know is that they contain some types which implement a given interface. The old, non-AppDomain-code looks like this (slightly shortened): try { string path = Path.GetFullPath("C:\library.dll"); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

AppDomain and MarshalByRefObject life time : how to avoid RemotingException?

不想你离开。 提交于 2019-11-27 17:09:54
When a MarshalByRef object is passed from an AppDomain (1) to another (2), if you wait 6 mins before calling a method on it in the second AppDomain (2) you will get a RemotingException : System.Runtime.Remoting.RemotingException: Object [...] has been disconnected or does not exist at the server. Some documentation about this isse : http://blogs.microsoft.co.il/blogs/sasha/archive/2008/07/19/appdomains-and-remoting-life-time-service.aspx http://blogs.msdn.com/cbrumme/archive/2003/06/01/51466.aspx - Instance Lifetime, cbrumme says "We should fix this." :( Correct me if I'm wrong : if

I don't understand Application Domains

╄→гoц情女王★ 提交于 2019-11-27 17:01:05
.NET has this concept of Application Domains which from what I understand can be used to load an assembly into memory. I've done some research on Application Domains as well as go to my local book store for some additional knowledge on this subject matter but it seems very scarce. All I know that I can do with Application Domains is to load assemblies in memory and I can unload them when I want. What are the capabilities other that I have mentioned of Application Domains? Do Threads respect Application Domains boundaries? Are there any drawbacks from loading Assemblies in different Application

Message Pumps and AppDomains

雨燕双飞 提交于 2019-11-27 16:57:38
问题 I have a a C# (FFx 3.5) application that loads DLLs as plug-ins. These plug-ins are loaded in separate AppDomains (for lots of good reasons, and this architecture cannot change). This is all well and good. I now have a requirement to show a Dialog from one of those plug-ins. Bear in mind that I cannot return the dialog Form to the main application and have it displayed there (the current infrastructure doesn't support it). Failure 1 In my DLL I created a Form and called Show. The dialog