appdomain

Ignore exceptions that cross AppDomains when debugging in Visual Studio 2010

China☆狼群 提交于 2019-12-01 15:27:01
I'm having problems with debugging an application that calls out to another AppDomain, because if an exception occurs in whatever the other AppDomain is doing, the exception bubbles up and causes Visual Studio 2010 to break no matter what. I've properly wrapped the method call that throws in a try/catch , and the exception is properly caught when I'm running the application (an ASP.NET MVC application) normally, but when debugging w3wp.exe in Visual Studio 2010, it always breaks on the method call that throws and there's no way I can get past the exception even though it should be caught. I've

Ignore exceptions that cross AppDomains when debugging in Visual Studio 2010

好久不见. 提交于 2019-12-01 15:08:35
问题 I'm having problems with debugging an application that calls out to another AppDomain, because if an exception occurs in whatever the other AppDomain is doing, the exception bubbles up and causes Visual Studio 2010 to break no matter what. I've properly wrapped the method call that throws in a try/catch , and the exception is properly caught when I'm running the application (an ASP.NET MVC application) normally, but when debugging w3wp.exe in Visual Studio 2010, it always breaks on the method

Why does Assembly.Load seem to not affect the current thread when resolving references (not through reflection)?

≯℡__Kan透↙ 提交于 2019-12-01 11:11:53
I apologize in advance if the title doesn't make sense. I'm very new to appdomains and assembly loading and don't really know how to state what I'm trying to ask. I have been fiddling around with loading embedded DLLs into an application during runtime and I can't seem to figure out why it works one way but not the other. It seems like if you try to load DLLs (from a byte array) into the current appdomain, any objects/threads created after that will be able to resolve references against the newly loaded library, however objects in the original context will not resolve against the newly loaded

Can I inject a thread in a remote app domain from C#

元气小坏坏 提交于 2019-12-01 09:39:05
I was wondering if its possible to inject a thread into a remote app domain running in a separate process. My guess is that I could do this using the debugging interfaces (ICorDebug) but I was wondering if there is any other way? There was recently an announcement of a new facility Mono provides to do just this. See this post on assembly injection . Mike Stall has an interesting sample on how to use CreateRemoteThread to inject remote threads in managed apps. This answer is still incomplete, cause I would like to run new code in the remote appdomain. I guess I could try creating 1 new thread

How can I load two versions of same assemblies into two different domains from two different subfolders?

て烟熏妆下的殇ゞ 提交于 2019-12-01 09:36:20
I'm trying to build a small tool for comparing types in a bunch of assemblies. For this purpose I created two subfolders and put the respective dlls there: ..\Dlls\v1.1 ..\Dlls\v1.2 where .. is the application folder I also created a proxy object: public class ProxyDomain : MarshalByRefObject { public Assembly LoadFile(string assemblyPath) { try { //Debug.WriteLine("CurrentDomain = " + AppDomain.CurrentDomain.FriendlyName); return Assembly.LoadFile(assemblyPath); } catch (FileNotFoundException) { return null; } } } and used it for loading in the following routine that should load an dll and

AppDomain shadow copying not working (original assemblies locked)

喜你入骨 提交于 2019-12-01 09:19:48
Here's a small class I'm using to probe for a list of available plugins: internal static class PluginDirectoryLoader { public static PluginInfo[] ListPlugins(string path) { var name = Path.GetFileName(path); var setup = new AppDomainSetup { ApplicationBase = path, ShadowCopyFiles = "true" }; var appdomain = AppDomain.CreateDomain("PluginDirectoryLoader." + name, null, setup); var exts = (IServerExtensionDiscovery)appdomain.CreateInstanceAndUnwrap("ServerX.Common", "ServerX.Common.ServerExtensionDiscovery"); PluginInfo[] plugins = null; try { plugins = exts.ListPlugins(); // <-- BREAK HERE }

Can I inject a thread in a remote app domain from C#

谁说我不能喝 提交于 2019-12-01 08:54:10
问题 I was wondering if its possible to inject a thread into a remote app domain running in a separate process. My guess is that I could do this using the debugging interfaces (ICorDebug) but I was wondering if there is any other way? 回答1: There was recently an announcement of a new facility Mono provides to do just this. See this post on assembly injection. 回答2: Mike Stall has an interesting sample on how to use CreateRemoteThread to inject remote threads in managed apps. This answer is still

How can I switch .NET assembly for execution of one method?

青春壹個敷衍的年華 提交于 2019-12-01 06:47:15
I have different versions of dlls for my .NET application and most of the time I want to use the latest one. However, there is one method which I run on a separate thread where I need to be able to select an older version of the dll based on some criteria. I have learned that it is not possible to just load an assembly and then unload it within the default application domain (I can't just keep both versions loaded because then I'm running into duplicate definitions of types problem) Probably I have to create a separate AppDomain, load the assembly there and then unload it. This application

AppDomain shadow copying not working (original assemblies locked)

北城余情 提交于 2019-12-01 06:21:57
问题 Here's a small class I'm using to probe for a list of available plugins: internal static class PluginDirectoryLoader { public static PluginInfo[] ListPlugins(string path) { var name = Path.GetFileName(path); var setup = new AppDomainSetup { ApplicationBase = path, ShadowCopyFiles = "true" }; var appdomain = AppDomain.CreateDomain("PluginDirectoryLoader." + name, null, setup); var exts = (IServerExtensionDiscovery)appdomain.CreateInstanceAndUnwrap("ServerX.Common", "ServerX.Common

How can I load two versions of same assemblies into two different domains from two different subfolders?

时光怂恿深爱的人放手 提交于 2019-12-01 05:36:08
问题 I'm trying to build a small tool for comparing types in a bunch of assemblies. For this purpose I created two subfolders and put the respective dlls there: ..\Dlls\v1.1 ..\Dlls\v1.2 where .. is the application folder I also created a proxy object: public class ProxyDomain : MarshalByRefObject { public Assembly LoadFile(string assemblyPath) { try { //Debug.WriteLine("CurrentDomain = " + AppDomain.CurrentDomain.FriendlyName); return Assembly.LoadFile(assemblyPath); } catch