remoting

How can I tell if another app has registered an IPC Remoting channel?

别来无恙 提交于 2019-12-01 18:14:39
问题 So I have an application which has a .NET API available. Their API library communicates with their main application through .NET remoting calls. In order to use the API, the application must be up and running already. So, I have an instance where I need to programmatically start the application and then instantiate one of the API objects, which attempts to open an IPC remoting channel to the main app. The problem is, after I start the process, there are a few seconds between startup and when

How can I tell if another app has registered an IPC Remoting channel?

 ̄綄美尐妖づ 提交于 2019-12-01 18:00:24
So I have an application which has a .NET API available. Their API library communicates with their main application through .NET remoting calls. In order to use the API, the application must be up and running already. So, I have an instance where I need to programmatically start the application and then instantiate one of the API objects, which attempts to open an IPC remoting channel to the main app. The problem is, after I start the process, there are a few seconds between startup and when the application registers the channel. If I try to instantiate an API object before the channel is

'ref' keyword and AppDomains

走远了吗. 提交于 2019-12-01 16:41:49
When I started using C# I was unsure of how references were treated exactly (whether they were being passed by value etc.). I wrongly thought the 'ref' keyword was needed when passing objects that would be modified by the called method. Then after reading threads like this , I realized 'ref' was only needed when you need to change the actual reference / pointer itself. But today I have come across an issue when passing a parameter via a remoting call, where ref was actually needed to modify the content of the object. When passed without ref, the object came back unchanged. I was told to add

.NET Remoting Exception not handled Client-Side

泪湿孤枕 提交于 2019-12-01 10:58:53
I checked the rest of the remoting questions, and this specific case did not seem to be addressed. I have a .NET Remoting server/client set up. On the server side I have an object with a method that can throw an exception, and a client which will try to call that method. Server: public bool MyEquals(Guid myGuid, string a, string b) { if (CheckAuthentication(myGuid)) { logger.Debug("Request for \"" + a + "\".Equals(\"" + b + "\")"); return a.Equals(b); } else { throw new AuthenticationException(UserRegistryService.USER_NOT_REGISTERED_EXCEPTION_TEXT); } } Client: try { bool result =

binary serialization, adding a new field to class - will it work?

我的未来我决定 提交于 2019-12-01 05:03:22
问题 I have a client and a server application which communicate over .NET 2.0 Remoting using binary serialization. A small change has been made to one of the data transfer object's interface and the implementing class, well, an array of strings field was added. If I to redeploy a new version of server application, will my old clients continue to work? I would think they would, since nothing has been deleted from interface and direct implementation, but I am not sure. It probably boils down to

COM+ component calling other COM+ components - “Cannot load type”

大城市里の小女人 提交于 2019-12-01 01:30:13
I have a two .NET assemblies which are registered as COM+ components and I'm testing them from a regular console application test harness; Dim objFirst As New MyFirstComponent() 'COM+ initialisation Dim RC As Boolean = objFirst.GetValue() The method call is executed successfully. This is the definition of MyFirstComponent; <ProgId("MyFirstComponent")> _ <Guid("...")> _ <ClassInterface(ClassInterfaceType.None)> _ <Transaction(TransactionOption.Supported)> _ Public Class MyFirstComponent Inherits ServicedComponent Implements IMyFirstComponent Public Function GetValue() As Boolean Implements

Getting running Visual Studio 2010 instances and programmatically attaching to a process?

限于喜欢 提交于 2019-11-30 23:21:05
I have a WinForms Application (.net 3.5) which displays a list of processes. I would like to be able to attach to one of those processes. I have multiple Visual Studio 2010 instances running and I would like to create a List/Dropdown where I select one of those instances and then attach the Debugger to it. Getting the VS2010 instances shouldn't be too hard, but I have no idea how to invoke the "attach to process" command. I want to avoid SendKeys-Type solutions, so I just wonder if there is some way to do that? edit: To clarify: I want to use a specific running VS2010 to debug an external

Remoting sponsor stops being called

心已入冬 提交于 2019-11-30 19:45:01
问题 I've got an app which creates several AppDomains in a single process and communicates between them via remoting. I create sponsors for all objects to prevent them from being GCed. But, some ended up being GCed anyway. After some investigation I've determined that depending on the InitialLeaseTime set on my remote objects, my sponsors are either never called or get called a couple times and then never again. My sponsor (I've removed some sanity checking for brevity): class Sponsor :

COM+ component calling other COM+ components - “Cannot load type”

扶醉桌前 提交于 2019-11-30 19:24:34
问题 I have a two .NET assemblies which are registered as COM+ components and I'm testing them from a regular console application test harness; Dim objFirst As New MyFirstComponent() 'COM+ initialisation Dim RC As Boolean = objFirst.GetValue() The method call is executed successfully. This is the definition of MyFirstComponent; <ProgId("MyFirstComponent")> _ <Guid("...")> _ <ClassInterface(ClassInterfaceType.None)> _ <Transaction(TransactionOption.Supported)> _ Public Class MyFirstComponent

Passing values back and forth appdomains

China☆狼群 提交于 2019-11-30 18:52:54
I have the following code: public class AppDomainArgs : MarshalByRefObject { public string myString; } static AppDomainArgs ada = new AppDomainArgs() { myString = "abc" }; static void Main(string[] args) { AppDomain domain = AppDomain.CreateDomain("Domain666"); domain.DoCallBack(MyNewAppDomainMethod); Console.WriteLine(ada.myString); Console.ReadKey(); AppDomain.Unload(domain); } static void MyNewAppDomainMethod() { ada.myString = "working!"; } I thought make this would make my ada.myString have "working!" on the main appdomain, but it doesn't. I thought that by inhering from