appdomain

How to Setdata to new Appdomain

限于喜欢 提交于 2019-12-12 00:01:56
问题 How to SetData to new created AppDomain. When i DoCallBack to my testFunc i receive " System.NullReferenceException " exception. What i do wrong? var client = "test"; var engine = 123; AppDomain appDomain = AppDomain.CreateDomain("newDomain"); appDomain.SetData("client", client); appDomain.SetData("engine", engine); appDomain.DoCallBack(testFunc); private void testFunc() { var client = (string)AppDomain.CurrentDomain.GetData("client"); var engine = (int)AppDomain.CurrentDomain.GetData("engine

Deserialization exception in AppDomain

耗尽温柔 提交于 2019-12-11 23:16:58
问题 I have a problem with deserialization of an object: byte[] cardData; // Serialize var mySerializer1 = new BinaryFormatter(); using (var ms = new MemoryStream()) { mySerializer1.Serialize(ms, new SuperClass()); cardData = ms.ToArray(); } // Deserialize var mySerializer2 = new BinaryFormatter(); using (var ms = new MemoryStream(cardData)) mySerializer2.Deserialize(ms); // throws an exception In the same file: [Serializable] public class SuperClass { } Exception: System.Runtime.Serialization

Load different version of assembly into separate AppDomain

余生长醉 提交于 2019-12-11 20:40:06
问题 I'm implementing application that supports plugins. Currently the problem arises when I try to load common assembly that is used both by host application and plugin: host application should use one version of that assembly, while plugin uses another version. This is dictated by application upgrade process - plugin can be updated separately from host application. Every assembly is signed, so I use strong names for loading assemblies. I created a test application which demonstrates the problem.

AppDomains, Unloading, and ThreadAbortException

放肆的年华 提交于 2019-12-11 13:09:03
问题 I'm trying to work with AppDomains for the first time and I'm finding myself a bit lost. Here is what I've done: I have a console app that instantiates a Bootstrapper class and calls Bootstrapper.Bootstrap. The class looks something like this: public class Bootstrapper : MarshalByRefObject { private static AppDomain SecondaryAppDomain; private Bootstrapper _secondaryDomainBootstrapper; public Robot CurrentlyRunningRobot; public Bootstrapper OwningBootstrapper; public Bootstrapper() { } public

The demand was for: <PermissionSet class=“System.Security.PermissionSet” version=“1” Unrestricted=“true”/>

▼魔方 西西 提交于 2019-12-11 11:33:14
问题 I'm getting the System.Security.SecurityException The demand was for: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/> when attempting to create an AppDomain with restricted permissions defined as follows: var permissionSet = new PermissionSet(PermissionState.None); permissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, System.Reflection.Assembly.GetExecutingAssembly().Location)); permissionSet

Controlling how P/Invoked assemblies are loaded into different app domains

我怕爱的太早我们不能终老 提交于 2019-12-11 10:25:45
问题 I've got an application which needs to call some unmanaged code in a dll. I need to do these calls from multiple app domains and specifically want the assembly to be loaded into memory multiple times (once per app domain). I've tried doing the following: Dim AppDomainSetup As New AppDomainSetup With AppDomainSetup .PrivateBinPath = "<Blah>" .LoaderOptimization = LoaderOptimization.MultiDomainHost End With Dim AppDomain As AppDomain = AppDomain.CreateDomain(String.Format("AppDomain-{0}",

Domain is not included in app domain

↘锁芯ラ 提交于 2019-12-11 07:05:56
问题 I am having this issue from couple of Days.Previously it runs quite good but now this is showing above error.I am not able to find out what i am missing?How can this issue be solved? image setting image some portion of RateReview public static String BASE_DOMAIN = "http://www.facebook.com"; public static String PATH_URL = "http://patanheritage.com/homestay/"; webViewComment.loadDataWithBaseURL(BASE_DOMAIN, "<html><head></head><body><div id=\"fb-root\"></div><div id=\"fb-root\"></div><script>

How to unload the default .NET AppDomain from an unmanaged application

烂漫一生 提交于 2019-12-11 06:00:08
问题 Is there a way to unload the default .NET AppDomain from an unmanaged application? I'm using a third party tool called .NET Extender for using .NET assemblies from within Visual FoxPro which allows me to host .NET controls and also make use of .NET classes and methods from within a FoxPro environment. The problem I'm having is that when debugging an application from within Visual FoxPro it runs the everything under the main vfp9.exe application file for the IDE and it appears that handles to

Running my HttpApplication in my own AppDomain

走远了吗. 提交于 2019-12-11 04:36:25
问题 I'm looking for a way to run my HttpApplication in an AppDomain I created myself programmatically. as the AppManagerAppDomainFactory is a sealed class, I wondered if there was a way to implement my own IAppManagerAppDomainFactory without having to patch IIS. If you're interested and want to know more I suggest this article Thanks for your suggestions (even if I don't think I'll get a acceptable answer ^^) 来源: https://stackoverflow.com/questions/6663841/running-my-httpapplication-in-my-own

Get access to AppDomain in another app?

放肆的年华 提交于 2019-12-11 04:29:27
问题 I'm trying to extend a freeware, proprietary piece of .Net 2.0 software, and it's been giving me grief. I successfully managed to inject a Win32 dll and get it to successfully load in the .Net dll into the primary app domain, but doing so caused their custom GUI system to lock up completely. Is it possible to get a reference to a remote AppDomain (running in another app) and perform operations on it (e.g. load an assembly, create a class)? The reason I'm asking is that I'm sure I saw