appdomain

Does Environment.Exit called from any AppDomain exit the entire process if not IsDefaultAppDomain?

假装没事ソ 提交于 2019-12-23 15:25:00
问题 My original belief about Environment.Exit was this: If called from the default AppDomain, the process would terminate. If called from an AppDomain other than default, the AppDomain would terminate and push the exit code into the return of AppDomain.ExecuteAssembly. This seemed logical to me, as it would forseeably be undesirable for a loaded AppDomain to unintentionally kill the entire process due to calling Environment.Exit instead of ending at the "}" like the accepted answer of https:/

Assemblies not unloading after AppDomain unload?

不想你离开。 提交于 2019-12-23 09:47:27
问题 I'm using an AppDomain in order to load assemblies and then unload them. However, I'm having a very strage problem. After the AppDomain is unloaded - I can still see in process explorer that some assemblies are loaded multiple times! Why are there remainders of the loaded assemblies? Doesn't an AppDomain.Unload frees all the AppDomain's loaded memory? You can see in the attached image: Total AppDomains are 3 (I created 3 AppDomains in the process's life-cycle) AppDomains: 1 (Currently only 1

AppDomains and GC Heap

夙愿已清 提交于 2019-12-23 09:37:42
问题 Is there single GC Heap process wide partitioned in such a way that each Application Domain has access to specific partition ? Or each Application Domain has separate GC Heap? I am sure about the other heaps such as HF Heap, LF Heap, Stub Heap, Handle Table and few more..., all these heaps are allocated separately for each application domain? Does the GC Heap also gets allocated separately? This may probably be true as objects cannot be passed between AppDomains unless object is serializable

GCHandle, AppDomains managed code and 3rd party dll

我是研究僧i 提交于 2019-12-23 09:29:22
问题 I have looking at many threads about the exception "cannot pass a GCHandle across AppDomains" but I still don't get it.... I'm working with an RFID Reader which is driven by a DLL. I don't have source code for this DLL but only a sample to show how to use it. The sample works great but I have to copy some code in another project to add the reader to the middleware Microsoft Biztalk. The problem is that the process of Microsoft Biztalk works in another AppDomain. The reader handle events when

One ASP.NET app (accidentally) in multiple app domains or frequent app recycing

自古美人都是妖i 提交于 2019-12-23 08:55:20
问题 I'm debugging an ASP.NET application which is seemingly randomly losing the content of some static fields. I did some simple custom logging (because even log4net was flaky), and found out that the application is being loaded into two app domains. Here is a snippet from the log: 6/27/2011 9:01:01 PM /LM/W3SVC/1/ROOT/MyApp-1-129537072581658334: log message 1 6/27/2011 9:01:01 PM /LM/W3SVC/1/ROOT/MyApp-1-129537072581658334: log message 2 6/27/2011 9:01:01 PM /LM/W3SVC/1/ROOT/MyApp-1

Unable to cast transparent proxy to type from AppDomain

不打扰是莪最后的温柔 提交于 2019-12-23 07:39:25
问题 I'm trying to create an object in an appdomain: var type = typeof (CompiledTemplate); var obj = (CompiledTemplate) domain.CreateInstanceAndUnwrap ( type.Assembly.FullName, type.FullName); However, I always get the following error: Unable to cast transparent proxy to type 'Mono.TextTemplating.CompiledTemplate'. I'm running on .NET 4.0, not Mono, despite what the namespace might suggest :) As far as I know, this error happens when .NET thinks that the Type & Assembly do not exactly match in the

How to configure single app domain to Two Applications?

微笑、不失礼 提交于 2019-12-23 05:50:12
问题 As i know for every application we host there is single app domain for respective applications which are hosted,but i want to use single app domain for my two applications as i have given same physical folder path for both applications.Please help if anyone knows,Thank you. 来源: https://stackoverflow.com/questions/55350815/how-to-configure-single-app-domain-to-two-applications

webapi and unhandled exception hook per appdomain

早过忘川 提交于 2019-12-23 01:12:52
问题 Having a WebApi 2.2 application - is it possible to make use of AppDomain's UnhandledException hook? I have a code similar to this: [assembly: OwinStartup("DevConfiguration", typeof(DevStartup))] namespace WebApi.Module { public class DevStartup { private const string ErrorEventSourceName = "WebApiHost"; private const int ErrorEventId = 600; [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlAppDomain)] public void Configuration(IAppBuilder app) { AppDomain

Is it possible to have one Exception handler for multiple timers in a C# class?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 18:48:10
问题 I have a C# program which runs a system tray application - transferring / moving / creating / editing files in the background. There is alot of exception handling and loop handling to prevent the program from crashing / getting stuck if the user manual deletes a file the program is working with. Unfortunately one of the computer the program is running on is having the program crash. The computer is very hard to get, and cannot have debugging software loaded on (it is an embedded PC outside

Using the LoaderOptimizationAttribute on a WCF service

十年热恋 提交于 2019-12-22 17:12:44
问题 I have a wcf service that uses the .net System.AddIns framework to load assemblies into a seperate process and app domain. To improve performance I want to enable the Cross-Domain FastPath. According to the documentation I need to add the LoaderOptimizationAttribute attribute to the main method of my host application. However I do not have a main method as I am using a service. So is it possible to use the attribute? If not then how can I ensure that the addin assemblies are loaded as domain