appdomain

Load Current Assembly into different AppDomain

房东的猫 提交于 2019-11-30 04:14:10
I have created an AppDomain with a different base directory. However, I cannot seem to load the currently executing assembly into the other AppDomain without having a copy of the current executing assembly in the base directory. I've even tried to load it from the bytes. I get no exception when I try to load, but when I try to use: domain.DoCallBack(new CrossAppDomainDelegate(... I get: Could not load file or assembly ........... The system cannot find the file specified. My code is as follows: private static void SaveAssemblies(Assembly ass, List<byte[]> assemblyByteList) { AssemblyName[]

What is the right way to set shadow copying for the default AppDomain

怎甘沉沦 提交于 2019-11-30 04:00:27
Relating to Can I make the default AppDomain use shadow copies of certain assemblies? , it describes a working solution to activate shadow copying within the default AppDomain for a specific directory. Basically it says to use these simple methods: AppDomain.CurrentDomain.SetShadowCopyPath(aDirectory); AppDomain.CurrentDomain.SetShadowCopyFiles(); But because the methods used here are marked as obsolete I was wondering what is now the correct way to accomplish the same. The warning message hints to: Please investigate the use of AppDomainSetup.ShadowCopyDirectories instead An AppDomain has a

Load Assembly in New AppDomain without loading it in Parent AppDomain

╄→гoц情女王★ 提交于 2019-11-30 01:54:21
I am attempting to load a dll into a console app and then unload it and delete the file completely. The problem I am having is that the act of loading the dll in its own AppDomain creates a reference in the Parent AppDomain thus not allowing me to destroy the dll file unless I totally shut down the program. Any thoughts on making this code work? string fileLocation = @"C:\Collector.dll"; AppDomain domain = AppDomain.CreateDomain(fileLocation); domain.Load(@"Services.Collector"); AppDomain.Unload(domain); BTW I have also tried this code with no luck either string fileLocation = @"C:\Collector

Running NUnit through Resharper 8 tests fail when crossing between projects due to AppDomain

回眸只為那壹抹淺笑 提交于 2019-11-29 21:15:35
I recently updated to Resharper 8, and when I tried to run a suite of projects. These tests contain two suites of integration tests that both use IISExpress to run a website, make web requests and check the responses. Running them in isolation is successful, and running all the tests would previously succeed. However, after the upate the second set of tests to run would fail. Investigation has revealed the AppDomain.CurrentDomain.BaseDirectory is staying as the first test to run instead of changing. Since the integration tests are composed of two projects, this is causing the second project to

URL Redirection and 1and1

南楼画角 提交于 2019-11-29 17:58:11
I've got an app up and running on Heroku. I've purchased a top level .com domain from 1and1 (I have other sites there, so I thought that would make life easier). When I attempted to redirect to my Heroku app, I was not allowed to modify the CName alias record like I have done for other sites - which were all subdomains. I was given two options: Frame redirect or HTTP redirect, I've tried both. The frame redirect doesn't seem to function at all - the page stays blank. The HTTP redirect does actually get to my heroku site, but when it displays the address bar shows myproject.herokuapp.com

What are app domains used for?

六月ゝ 毕业季﹏ 提交于 2019-11-29 17:02:11
问题 I understand roughly what an AppDomain is, however I don't fully understand the uses for an AppDomain. I'm involved in a large server based C# / C++ application and I'm wondering how using AppDomains could improve stability / security / performance. In particular: I understand that a fault or fatal exception in one domain does not affect other app domains running in the same process - Does this also hold true for unmanaged / C++ exceptions, possibly even heap corruption or other memory issues

How to host an IronPython engine in a separate AppDomain?

故事扮演 提交于 2019-11-29 15:27:02
问题 I have tried the obvious: var appDomain = AppDomain.CreateDomain("New Domain"); var engine = IronPython.Hosting.Python.CreateEngine(appDomain); // boom! But I am getting the following error message: Type is not resolved for member 'Microsoft.Scripting.Hosting.ScriptRuntimeSetup,Microsoft.Scripting, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Googling for this error has not proved fruitful sofar... EDIT #1: I tried to create a minimal reproducing project by copying the

Restrict plug-in assembly code access

一世执手 提交于 2019-11-29 14:59:58
问题 I'd like to create a plug-in architecture where I can limit an assemblies API to something very restricted, i.e. only allow a whitelist of functions. Is it possible to restrict what functions/methods a plug in assembly can call? Can I do it using AppDomains? Does anyone have a simple example? 回答1: .NET has added the "Managed Addin Framework" that might fit the bill. It has the following features: Isolation . Plugins run in their own AppDomain if desired, or even their own process if you need

What happens to the static data in a class if it is accessed across app domains?

偶尔善良 提交于 2019-11-29 13:56:13
I have a static class which has some static data. What happens to the data if its accessed from different app domain? Will there a copy of a static class for each domain? Will the primitive types be copied? What if the data is serializable? Paul Tyng The memory between AppDomain's is not shared. By default the objects are a deep clone, if they are MarshalByRef then its similar to remoting where the calls are executed across AppDomain, so it appears that its shared state. MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging

Azure Websites AppDomain many restarts

南楼画角 提交于 2019-11-29 11:15:00
I've a group of asp.net 4.0 Websites runing in Azure Websites Compute mode: Standard Location: North Europe Capacity autoscale: Off Instance size: Large Instance Count: 1 The response time is very slow, the trafic is normal, but my log show many AppDomain shutdowns (more than 3 in one minute) . My websites load data in cache during de Application_Start to give a rapid response to all subsequents requests but if the Appdomains restarts every time is impossible to give acceptable response times. The ShutdownReason values are many: ConfigurationChange HostingEnvironment