appdomain

AppDomain shadow copied file access denied with ASP.NET site running on IIS6

三世轮回 提交于 2019-12-25 00:22:53
问题 I have some trouble with the shadow copy feature of AppDomains in combination with a ASP.NET website running under IIS. The problem is that the shadow copied files can not be read or executed by the IIS user because of insufficient permissions. I get the following error message when the code in the new AppDomain is executed (through a callback method via DoCallBack): System.IO.FileLoadException: Could not load file or assembly 'My.Namespace.AssemblyName, Version=0.0.3.2231, Culture=neutral,

Is it possible to enumerate the AppDomains in a remote process?

不想你离开。 提交于 2019-12-24 19:13:58
问题 I have seen this question and a number of blog posts related to using mscoree.CorRuntimeHostClass.EnumDomains method to enumerate the AppDomains within the current process, but I'm wondering if there's a way to enumerate the AppDomains within a separate process on the same machine. I'd like to be able to write a simple console or even WinForms app that could take a process ID and be able to give me some information about the AppDomains within that process. Is this even possible? I assume it

Loading byte array assembly into new AppDomain throws a FileNotFound exception

落花浮王杯 提交于 2019-12-24 17:19:12
问题 I'm trying to do the following: Download a byte array that contains an assembly that I need to execute. Load an object from this assembly in a new app domain and execute method on the object Here is my code that attempts to load the assembly into new app domain: public object Execute(byte[] agentCode) { var app = AppDomain.CreateDomain("MonitoringProxy", AppDomain.CurrentDomain.Evidence, new AppDomainSetup {ApplicationBase = AppDomain.CurrentDomain.BaseDirectory}, new PermissionSet

AppDomain DoCallBack FileNotFoundException - C#

这一生的挚爱 提交于 2019-12-24 15:15:26
问题 I have a C# 2.0 class with the following code: public class MyClass : MarshalByRefObject, IDisposable { private string _appName; private AppDomain _app; public MyClass(string appName) { _appName = appName; _app = AppDomain.CreateDomain("NewDomain" + _appName); _app.DoCallBack(new CrossAppDomainDelegate(CallBackMethod)); } public void Dispose() { AppDomain.Unload(_app); } public static void CallBackMethod() { //some operations } } This class is contained under a Class Library Project, then

Call a SignalR method from a different AppDomain

别等时光非礼了梦想. 提交于 2019-12-24 10:34:33
问题 I have a working web server written in C# using SignalR. It's a self-hosted Owin Application. Everything works fine. Now I have to relocate my controllers in different AppDomains. This breaks the SignalR part, because GlobalHost remains the same only within one AppDomain, and is not serializable (thus I can't pass it along to other AppDomains as it is). I've found a lot of examples/questions/tutorials about calling SignalR hubs methods from a Controller/an other class/whatever, but nothing

Stopping Application Loop in secondary AppDomain

╄→尐↘猪︶ㄣ 提交于 2019-12-24 08:46:35
问题 First off, apologies for the length... I have a Host/Plugin application akin to MAF. We are not using any of the System.Addin or associated namespaces as this is a custom plugin architecture with multiple AppDomains in play. The Host UI (user interface) is running in it's own application loop (AppDomain). When an item in a listview is double-clicked the following occurs: private static void StartPeripheralModule(string modName) { AppDomain domain = AppDomain.CreateDomain(modName); // add to

Why return BAD IL FORMAT to load assembly from wcf service?

六月ゝ 毕业季﹏ 提交于 2019-12-24 07:46:48
问题 I want to load this Class library : namespace ClassLibrary1 { public class Class1 { public Class1() { } public static int Sum(int a, int b) { return a + b; } } } I have a wcf service which returns to me a byte[] array ( ClassLibrary1 ) i can not load this assembly static void Main(string[] args) { FileTransferService.ApplicationHostServiceClient client = new FileTransferService.ApplicationHostServiceClient(); FileTransferService.AssemblyPackage[] asmbs = client.GetFile(); //var newDomain =

Why can't I subscribe to an event in a partial-trust AppDomain?

落花浮王杯 提交于 2019-12-24 01:19:54
问题 In my default (full-trust) AppDomain I want to create a sandbox AppDomain and subscribe to an event in it: class Domain : MarshalByRefObject { public event Action TestEvent; } Domain domain = AppDomainStarter.Start<Domain>(@"C:\Temp", "Domain", null, true); domain.TestEvent += () => { }; // SecurityException Subscription fails with the message "Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0...' failed." (For the definition of

Get AppDomain for another .NET framework process

徘徊边缘 提交于 2019-12-23 20:24:11
问题 I am trying to get the AppDomain for all the .NET Framework processes running on my machine. Any advice on how to do that? 回答1: Im not entirely clear on what you are trying to do, but if you want to enumerate all running AppDomains by attaching Visual Studio to a process, see this link: Jack Gudenkauf "Enumerating AppDomains" In that same vein, if you want to do this AT RUNTIME (without Visual Studio) then you will probably need to include a managed debugger in your program which will allow

C#, MAF, Unhandled Exception Management in separate AppDomain

两盒软妹~` 提交于 2019-12-23 16:25:22
问题 Okay, so I have a MAF application which loads up each addin inside of a separate appdomain. This is working fantastic for what I need as it allows me to dynamically unload and reload my addins at runtime. The problem is, I need to be able to take an unhandled exception in the child appdomain, catch it, and then let that appdomain fail gracefully without taking down the parent appdomain How do I go about doing this? It seems like a trivial task and one of the main benefits of using isolated