appdomain

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

这一生的挚爱 提交于 2019-12-13 12:08:51
问题 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

Dynamically loaded Assembly not loading in new AppDomain

与世无争的帅哥 提交于 2019-12-13 06:17:49
问题 This is not a duplicate - I have reviewed this related StackOverflow question with no luck: How to Load an Assembly to AppDomain with all references recursively? I have two console applications. AssemblyLoaderTest.exe and testapp.exe I am trying to use AssemblyLoaderTest.exe to dynamically load testapp.exe and call a method from a class within testapp.exe So far the code works - the method "TestWrite()" in testapp.exe is executed correctly (and outputsuccess.txt is written), however , testapp

WCF service Appdomain details

丶灬走出姿态 提交于 2019-12-13 03:00:01
问题 I am reading WCF book.It states that the client can consume service running on same AppDomain or different application Domain. Suppose I am creating a service in IIS localhost. example localhost\TestService\Service.svc (WCFService Website). and my client is in d:\demo\client (windows form) Does it mean client is running on different AppDomian and Service is running on different Appdomain? How can i have client and service both running on same AppDomain? 回答1: No. The book is saying that it's

Unregister Lease throws InvalidOperationException

百般思念 提交于 2019-12-12 22:14:21
问题 I have a application that uses plugins. I load the plugins in another appdomain. I use the RemoteHandle class from http://www.pocketsilicon.com/post/Things-That-Make-My-Life-Hell-Part-1-App-Domains.aspx to keep object from being garbage collected after 5 minutes. This works great as long as my application is running, but when it is shutting down i get a InvalidOperationException when Unregistering internal static void Unregister(MarshalByRefObject value) { if (value != null &&

Assembly.CreateInstance returning null even though I can see the class in DefinedTypes

有些话、适合烂在心里 提交于 2019-12-12 19:36:41
问题 I use the following method to load a new Assembly and create an instance of a class into a new AppDomain. private static object CreateInstanceFromBinary(AppDomain appDomain, string typeName) { Assembly entryAssembly = Assembly.GetEntryAssembly(); byte[] assemblyBinary = LoadAssemblyBinary(); Assembly loadedAssembly = appDomain.Load(assemblyBinary); if (loadedAssembly != null) { return loadedAssembly.CreateInstance(typeName); } return null; } Which get's called like so. AppDomain appDomain =

How to send nonserializable objects as arguments to a proxy method. MarshalByRefObject wrapper?

眉间皱痕 提交于 2019-12-12 14:49:50
问题 I'm am currently revising a plugin architecture so that it utilizes AppDomains. The main difference between my plugins and the many examples I have found online is that instead of the plugin running and sending its results back to the main application, my main application is the one sending information to the plugin. As it currently stands, I create an instance of the loader in a separate AppDomain. It then does all your normal initialization such as loading the plugin assembly. As this point

Add directories to ASP.NET shadow copy

╄→гoц情女王★ 提交于 2019-12-12 14:25:35
问题 In my ASP.NET app, I'm attempting to add another directory to be have the DLLs in it shadow copied. The only method I found that will allow m to do this is AppDomain.CurrentDomain.SetShadowCopyPath . However, this method is marked as Obsolete . MSDN has this to say about it SetShadowCopyPath(String path) Message: AppDomain.SetShadowCopyPath has been deprecated. Please investigate the use of AppDomainSetup.ShadowCopyDirectories instead. However, the AppDomainSetup.ShadowCopyDirectories

No SynchronizationContext when calling Await in a another AppDomain

无人久伴 提交于 2019-12-12 12:54:38
问题 I have successfully built a plugin mechanism where I can create UI controls in a separate AppDomain and display them as part of a Form in the main AppDomain. These UI controls do their own data loading so when I open a form about 10 different plugins get created and each needs to load its data. Again this all works fine if I do it synchronously but I would like to use the async/await pattern in each plugin. My refresh method looks like this: protected async void RefreshData() { _data = await

Method does not have an implementation when loading assemblies into a new AppDomain in ReflectionOnly mode

馋奶兔 提交于 2019-12-12 12:19:53
问题 In our application (solution with 65 projects), all referenced assemblies are analysed in run-time for the presence of Ninject modules (there is some filtering applied too). The modules are loaded later into the Ninject kernel and each module declares bindings for the kernel. We have adopted a loader that loads the referenced assemblies into a separate assembly in reflection only mode. The difference from the way Ninject can load assemblies from the directory is that the directory can contain

.NET LocalReport / .rdlc AppDomain issues

こ雲淡風輕ζ 提交于 2019-12-12 10:58:06
问题 I'm using Microsoft.Reporting.WebForms.LocalReport and .rdlc Report files to generate .pdf:s. This is done in the background in a Windows Service (.NET 4.6, x64, VS2015). I'm having two issues: The Windows service keeps consuming memory an eventually OutOfMemoryException is thrown and process terminates At one occation the entire WindowsSerivce terminated with UnhandledException despite everything being enclosed in a try-catch statement. Now, I've read somewhere LocalReport under .NET 4 has