appdomain

Read assembly Guid without locking the DLL in an appdomain in medium trust ASP.Net

Is it possible to read the GUID from the Assembly without actually loading it in the current App Domain. Normally Assembly.Load loads the DLL into the app domain. I just want to read the value. The description of the GUID is 'The following GUID is for the ID of the typelib ' if this project is exposed to COM <Assembly: Guid("DEDDE...

How do I dynamically load raw assemblies that contains unmanaged code?(bypassing 'Unverifiable code failed policy check' exception)

I'm going to give an example of using System.Data.SQLite.DLL which is a mixed assembly with unmanaged code: If I execute this : var assembly= Assembly.LoadFrom("System.Data.SQLite.DLL") No exceptions are thrown, but if I do this : var rawAssembly = File.ReadAllBytes("System.Data.SQLite.DLL"); var assembly = Assembly.Load(rawA...

Where are Silverlight assemblies stored when a xap file is run?

We currently have a XAP file which contains Foo.dll, and another XAP file (with a completely different name) which contains an updated version Foo.dll (but the same version number). When we run the second XAP file, it looks as though the Silverlight runtime on the client, is picking up the old version of Foo.dll from the first XAP file....

.net - failed to create app domain

Hi just looking for abit of guidance here if possible. I recently downloaded a .net component for VS 2008 to handle sftp. After struggling with it for a day i uninstalled and deleted it. When going back into VS 2008, any of my previous projects have this error at the bottom in the error window: failed to create app domain. I was goin...

AppDomain.Unload does not unload Assembly

I want to read a piece of information from an assembly and then append a short text to the DLL-file. Step 1 works fine, but during step 2 I get an exception as the file still is in use. This is the case although for step 1 I loaded the assembly in another appdomain and unloaded this appdomain after I finished. Are there any additional ...

What are the steps for making domain-neutral assemblies?

...and can those steps also be applied to a 3rd party assembly (that might already be strong-named)? The context for my question should not be important, but I'll share anyway: I'm thinking of making a logger (or log-wrapper) that always knows what "log source" to target, regardless of whether the assemblies using it are in one appdomai...

How to force the unmanaged to managed calls to use the default appdomain?

Hi, I have been trying to fix this issue for quite sometime now. I have a C# user control wrapping an activex control (through wrappers created by RCW); This particular activex control loads MFC extension dll which has got C# WPF assembly dependant. This MFC extension dll calls C# WPF assembly through classes compiled as managed (using ...

Load different COM files with same names (older versions) from different paths in C#

Hello, i need to build a program that load older versions of a COM DLL file and performs some operations. I've created a DLL project for each version and set the reference to the correspondent COM. After that in the main program i'm trying to load the needed assembly that load and use itself its COM. The problem is that the DLLs have Int...

Ignore exceptions that cross AppDomains when debugging in Visual Studio 2010

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 ca...

Why is my C# AppDomain fine one moment, then throws exceptions the next?

I have an AppDomain that I'm using to load modules into a sandbox with: class PluginLoader { public static AppDomain PluginSandbox; static PluginLoader() { AppDomainSetup ads = new AppDomainSetup(); ads.ApplicationName = "Plugin Modules"; PermissionSet trustedLoadFromRemoteSourceGrantSet = ...

Load independent assembly in a another App Domain

Hi, simple question, probably easy for you to answer. I have a dll named "MigrationSteps.dll" in the same output folder of my application. What I want to do, is to load this assembly in a new AppDomain and execute a method on an instance of a class inside this DLL. Here's my code string migrationStepsDllPath = Path.Combine(AppD...

Problems with AssemblyResolve event on created AppDomain

Hello, I am trying to customize the assembly resolution process by wrapping the AppDomain and its AssemblyResolve event inside a class. The simplified version of my ClassLoader is below. The problem I am having is that when the event AssemblyResolve is fired, it seems that I get a new instance of ClassLoader, not the one I previously c...

How do appDomain provide Isolation.

In my window forms application, I create a Appdomain say sandBox. In this sandbox i excute some code Say TestMethod from TestAppdomain Class. This class is in Test.dll which is not loaded in the current appdomain (Default appdomain). Now while executing TestMethod some exception occurs, then I want the sandbox domain to be unloaded and ...

Create AppDomain with web context

I'm building an ASP.NET MVC web application that supports plugins in the form of bundled .dll files that can contain (among other things) precompiled (through aspnet_compiler.exe) .aspx view pages as well as Controller objects handling requests. I've built the plugin system so that all plugins are contained within a separate AppDomain t...

Multiple AppDomains: Keeping the Console Open

I have an integration test harness which launches a console exe several times, simultaneously, each in its own appdomain. As soon as any one of the console exe applications exits from its appdomain, it causes stdin, stdout, stderr to shutdown for all of the remaining console exe appdomains as well. That is, the console is closed even t...

Why would IIS "start" an App that is still running?

We have an ASP.NET (3.5 SP1) application running on IIS7 / Windows 2008. We trap Application_Start and Application_End events in Global.asax. We also host WCF services in the app and trap the OnOpening and OnClosing events via a ServiceHostFactory. Thus, we thought, we are guaranteed notification of any application start and stop, sch...

.Net - Load Type dynamically from AppDomain without remoting proxy

I've loaded a specific AppDomain up and I want to load some types dynamically from it (piece of cake right?). The thing is all of the CreateInstance methods of the AppDomain class return things as a remoting object handle. Remoting proxies have limitations that I would like to avoid such as: having to have serializable concrete classes, ...

Running Topshelf service using ConfigureServiceInIsolation - Generic Host

I am developing a very simple Generic Host solution that will allow us to host assemblies as windows services (ala NServiceBus). I'm coming across the following exception (similar to the comments mentioned on Dru's blog post). I need this to work so I can host services in different AppDomains. "Type 'MyProject.WindowsServices.GenericHos...

Parser Error : Could not load type "x" from appdomain from within virtual directory in IIS7

So my scenarios a little funny but theres a reason for it. I have a parent web application, called Parent, and a second web application called Child. Child is a virtual directory in IIS7 under Parent which is an application in IIS. Child is not a child directory of parent in the file system, only in IIS as a virtual directory. On appli...

How to unload an app domain created in a singleton in a WCF class lib?

Hi, please help me with this issue. I have a singleton Class A in a DLL. In the create instance of class A, I call AppDomain.CreateDomain for another DLL that contains class B. This means that my Class A now has a reference to the AppDomain object. I use singleton Class A b/c my client app is a web app and I don't want to load/unload ...