Simplest way to make cross-appdomain call?

前端 未结 2 1176
不知归路
不知归路 2020-12-03 18:02

I need to call a method of object in another appdomain (pass param and get result). Ideas?

UPD both AppDomain\'s are created not by my code (host app creates it, and

2条回答
  •  甜味超标
    2020-12-03 18:25

    This is usually achieved using AppDomain.DoCallBack. You need to make sure that if you want to pass parameters, you need to create a serializable object, whose method you pass to the method described above. In the callback method you can perform another AppDomain callback to pass the result back to the original AppDomain.

提交回复
热议问题