appdomain

AppDomain support is dead in UnityEngine, any way to unload dll?

回眸只為那壹抹淺笑 提交于 2019-12-04 18:10:37
I am kinda stuck on not being able to dispose .NET 3.5 dlls from the process. AppDomain support is off in unity, there is no way to unload a dll from the process using the .NET api, because the C# functions are not implemented. Anyone could get me some hints on how / where should I start to remove the dll from the memory / process somehow, so I can re-load the dll whenever I want? Alright, after this time I thought that this is some sort of heavy research, and there are no publications related to this. So here is what you have to do. First head over to https://github.com/mono/mono/branches/all

Dynamically Loaded Assembly - Settings & Communication

不问归期 提交于 2019-12-04 17:00:47
Ok so... I have a WPF application (let's call it Launcher.exe ) which loads and executes another WPF application (let's call it Loaded.exe ) dynamically using something like this: Byte[] assemblyData; using (BinaryReader reader = new BinaryReader(new FileStream(filePath, FileMode.Open))) assemblyData = reader.ReadBytes(Convert.ToInt32(fs.Length)); Assembly assembly = Assembly.Load(assemblyData); MethodInfo method = assembly.EntryPoint; if (method != null) { Object instance = assembly.CreateInstance(method.Name); method.Invoke(o, null); } Now... the problem is that Launched.exe has its own

Marshalling C++ pointer interface back though C# function call in a non default AppDomain

前提是你 提交于 2019-12-04 14:57:36
I have a working CLI interface between C++ and C# code. The code has a C++ abstract interface like: -------------C++ Interface--------------- namespace cppns { class cppInterface { public: virtual bool Start(const char *pcDir) = 0; }; } ------Implementation of abstract C++ interface in same dll--------- namespace cppns { class cppimp : public cppInterface private: gcroot<MyInternalCSharpClass^> mInternalClassAccess; public: cppimp::cppimp() { mInternalClassAccess = gcnew MyInternalCSharpClass(); } virtual bool cppimp::Start(const char *pcDir) { System::AppDomain ^appDom = AppDomain:

Does COM interop respect .NET AppDomain boundaries for assembly loading?

怎甘沉沦 提交于 2019-12-04 12:10:55
问题 Here's the core problem: I have a .NET application that is using COM interop in a separate AppDomain. The COM stuff seems to be loading assemblies back into the default domain, rather than the AppDomain from which the COM stuff is being called. What I want to know is: is this expected behaviour, or am I doing something wrong to cause these COM related assemblies to be loaded in the wrong AppDomain? Please see a more detailed description of the situation below... The application consists of 3

ASP.NET Web application doesn't unload AppDomains after deploy

狂风中的少年 提交于 2019-12-04 11:50:08
问题 When we deploy our web application we copy all the code to a new directory and then point iis to that new directory. When we do this the number of appdomains increases but never decreases. Also, our Application_End event never seems to fire. For some unknown time, while both sets of AppDomains are still reported by perfmon, the system performs very poorly while % time in GC spikes to 100%. Eventually I recycle the app pool to get the app running smoothly again. Extra piece of info: listing

Custom AppDomain and PrivateBinPath

↘锁芯ラ 提交于 2019-12-04 10:39:47
问题 I'm using c# 4.0 and a console application just for testing, the following code does gives an exception. AppDomainSetup appSetup = new AppDomainSetup() { ApplicationName = "PluginsDomain", ApplicationBase = AppDomain.CurrentDomain.BaseDirectory, PrivateBinPath = @"Plugins", ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile }; AppDomain appDomain = AppDomain.CreateDomain("PluginsDomain", null, appSetup); AssemblyName assemblyName = AssemblyName.GetAssemblyName

How can I use CodeDOM to create and load an assembly in an AppDomain?

妖精的绣舞 提交于 2019-12-04 09:12:24
I am working on a project that will use CodeDOM to create a class that evaluates a user-defined expression, creates an assembly for the class, and loads the assembly. Since there can be a fair number of user-defined expressions, I would like to first create an AppDomain, execute the CodeDOM creation/loading and executing for the assembly within that AppDomain, and then unload the AppDomain. I've searched quite a bit, and found many examples of how to load an existing assembly into an AppDomain, but I can't seem to find one that shows me how to create the assembly from within the AppDomain.

How to properly access the PrivateBinPath property of the current AppDomain?

匆匆过客 提交于 2019-12-04 06:57:33
Since AppDomain.AppendPrivatePath() is obsolete, I'm trying to figure out how to specify a PrivateBinPath for the current AppDomain in my project without spinning up a whole new AppDomain, and being able to access it later. I know I can set the PrivateBinPath on an AppDomainSetup object (which would be ok if I wanted to create a new AppDomain), and I also know that I can add it to my app.config like so: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath=".\AlternateLookupPath" /> </assemblyBinding> </runtime> However, when adding this entry to my app

Using AppDomains to Parallelize Non-thread-safe DLL

我们两清 提交于 2019-12-04 04:58:55
I have an unmanaged C++ DLL that my .NET application uses via p/invoke. The method that I need from this DLL is fairly time consuming and I would like to parallelize the method calls. The problem is that it uses a bunch of statics and globals, so it is not thread-safe (and can't be changed). My plan was to overcome this non-thread-safe issue by calling the unmanaged DLL from multiple AppDomains in parallel. I can call the unmanaged code from the multiple AppDomains without any problems as long as I don't do it in parallel, but as soon as I make the calls in parallel, I get an

Can Unhandled Exceptions in Child AppDomains be prevented from crashing the main process?

▼魔方 西西 提交于 2019-12-04 03:07:04
问题 I'm writing a small plugins library which uses app domains to isolate plugins using .Net framework 4.0. Hence the code that goes in each plugin is out of my control. When an unhandled exception is raised in one of the plugins, I have observed the results to be kind of a mixed bag. They are as follows. When the unhandled exception gets thrown in the plugin's main thread, the main pluggable app calling the plugin's execute method is able to catch and handle it cleanly. No problems there.