marshalbyrefobject

Accessing JavaScript Objects from vb.net

五迷三道 提交于 2021-01-29 07:02:11
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

Accessing JavaScript Objects from vb.net

三世轮回 提交于 2021-01-29 06:56:20
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

Is using the `Marshal` static class in otherwise normal C# code unwise?

血红的双手。 提交于 2020-03-10 04:40:48
问题 I have a whole sequence of interlinked questions. I would like to know answers for all of them independantly, so *yes*, some of them appear to be X-Y questions; but I do want to know the solution to them anyway!. See end of question for list of other questions in this set. For reasons that aren't relevant to this specific question I've ended up in an event handler, triggered by a catch block in some library code. I want to know why my EventHandler triggered, but I don't seem to get told that

How to debug appdomain return values in VS

梦想与她 提交于 2020-01-04 04:27:05
问题 my c# programm is using multiple appdomains to load/unload assemblies. My assemblies in the 2nd appdomain are returning an object which inherits MarshalByRefObject. My Problem now is that Visual Studio tells me that it can't Show information about it. Obtaining the runtime type of a transparent proxy is not supported in this context. I can see information about this object when I'm in a class of the 2nd appdomain. My question now: is it somehow possible to tell Visual Studio to Show me

Mixing MarshalByRefObject and Serializable

 ̄綄美尐妖づ 提交于 2019-12-30 04:46:06
问题 Various sources explain that When an object derives form MarshalByRefObject, an object reference will be passed from one application domain to another rather than the object itself. When an object is marked with [Serializable], the object will be automatically serialized, transported from one application domain to another and then deserialized to produce an exact copy of the object in the second application domain. Note then that while MarshalByRefObject passes a reference, [Serializable]

Can't set synchronization context when using appdomains

无人久伴 提交于 2019-12-25 01:47:12
问题 I have a custom framework where a host application runs an event loop and loads a guest application into a separate app-domain. The guest application has means to take advantage of the event loop via a provided API. I want to make the guest application be able to automatically propagate all continuations onto the event loop much like it's done in .NET GUI applications and the UI thread. Therefore, I create a custom synchronization context which is able to do that. But the problem is I can't

How do the In and Out attributes work in .NET?

我们两清 提交于 2019-12-17 07:37:16
问题 I have been trying to serialize an array across an AppDomain boundary, using the following code: public int Read(byte[] buffer, int offset, int count) { return base.Read(buffer, offset, count); } As a guess, after noticing the attributes elsewhere, I marked the method's parameters with [In] and [Out] attributes, which seemed to cause the parameters to behave as if they were passed by reference. For example: public int Read([In, Out] byte[] buffer, int offset, int count) { return base.Read

Garbage collecting objects crossing AppDomain boundary

送分小仙女□ 提交于 2019-12-13 13:31:14
问题 When you pass an object that inherits from MarshalByRefObject to a different AppDomain, won't GC.Collect() induced by the AppDomain that created it collect the object, provided that the object is not rooted in either AppDomain by the time GC.Collect() called? [When I say not rooted I mean no developer written code access it anymore.] It appears that the object is not getting collected but rather getting promoted to the next generation! But if I stop passing the object to a diff AppDomain, it

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

Passing data across appdomains with MarshalByRefObject

旧城冷巷雨未停 提交于 2019-12-12 08:15:47
问题 I'm having a little trouble passing some data between two .NET appdomains and I'm hoping someone on here can help me. Basically what I have is a main application ( Main ) which loads assembly A and B into it's main domain, then when I run a plugin( C ) Main calls a create domain method on B which creates a new domain and loads C and a instance of B into it, so that C can only access B and not the others. B contains a pointer to the IDispatch of Main but only it seems to get it after it is