.net-remoting

Multi-platform compilation: System.Configuration.ConfigurationManager.GetSection throws error on .NetCore

a 夏天 提交于 2020-06-23 03:31:23
问题 Background: We are in the process of migrating .Net application to .Net Core. As a strategy, we would like to keep the existing functionality intact on Full framework while migrating portion of the application to .Net Core. Full application would support .services over Net remoting and REST API whereas .Net core application will only support REST API services. We have decided to keep the same code base for entire application and support compilation on multiple platforms (NetcoreApp2.1 and

parameter less constructor error

对着背影说爱祢 提交于 2020-01-17 05:13:31
问题 I'm trying to make my client subscribe to events that happen on my server. I have an interface that looks like this: public delegate void RemoteEventHandler(object sender, ClientEventArgs args); [Serializable] public class ClientEventArgs : EventArgs { public ClientEventArgs() { } public ClientEventArgs(Client _client) { MyClient = _client; } public Client MyClient { get; set; } } public interface IMonitor { event RemoteEventHandler RemoteEvent; } My Server Class looks like this: public class

c# remote events

北城余情 提交于 2020-01-03 01:59:05
问题 I'm trying to do a server client application to learn more about remote programs using c#. The structure is quite simple. I have a server which triggers an event when the function updateInventory is called and each client registers a function to the event (using a delegate). So when any of the client updates the inventory (by calling the updateInventory function) all the clients are warned about it by ways of the event. Now the problem is that it simply isn't working, when a client calls the

WCF vs. .Net Remoting

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 08:12:10
问题 according to this article, WCF with named pipes is the best choice for IPC, and it is around 25 % faster than .Net Remoting. I have the following code that compares WCF with named pipes with .Net Remoting: [ServiceContract] internal interface IRemote { [OperationContract] string Hello(string name); } [ServiceBehavior] internal class Remote : MarshalByRefObject, IRemote { public string Hello(string name) { return string.Format("Hello, {0}!", name); } } class Program { private const int

Can I remove empty catch with throw?

寵の児 提交于 2019-12-28 16:30:45
问题 I'm hoping this is straightforward. I work on a large code-base, the overall quality is good, but occasionally you get some of these: try { // Calls a .NET remoting method. } catch { throw; } Note there is no finally logic and the catch does not specify any exceptions or do anything other than what I've provided above. However, I know that catching and re-throwing can alter the call-stack in the exception details. What I'm not sure about is if this behaviour is here specifically because of a

Get the AppDomain of object

强颜欢笑 提交于 2019-12-23 07:29:14
问题 Is there any way to determine in which AppDomain was an object or ObjectHandle instance created? 回答1: If your object "travelled" using (e.g.) serialization from another AppDomain to the current AppDomain then it has essentially been "created" in your current AppDomain. The source AppDomain could be a separate process on the current computer or another process on a remote computer. As far as I am aware, I don't think that the CLR keeps track of that for you, since you are responsible for

System.InvalidCastException when creating a client activated object using an older version of an interface defined in a strong named assembly

和自甴很熟 提交于 2019-12-17 21:32:49
问题 I have a query about .Net Remoting, versioning and creating client activated objects. Here is the scenario: There are 2 interfaces, residing in their own assembly “SharedTypes”: IServer and IAccount. IServer contains methods “GetStatus” which returns a string, and “CreateAccount” which returns an IAccount type. This is registered into the GAC as v1.0.0.0. Server application references SharedTypes and implements IServer and IAccount with concrete classes, Server and Account. These are

How do the ISponsor and ILease interfaces work?

左心房为你撑大大i 提交于 2019-12-17 16:49:39
问题 I've created a object that inherits from MarshalByRefObject and ISponsor . In my implementation of ISponsor I just return a timespan to indicate how long I want the object renewed for. When I call InitializeLifetimeService() to get an ILease reference to be passed into my ISponsor object it never appears to be used from examples I've seen. ISponsor just seems to return a TimeSpan without actually using the ILease reference. But I'm sure there is more going on here since remoting is involved.

.net remoting - Problems with List<T>

ぃ、小莉子 提交于 2019-12-13 03:25:13
问题 I am developing a client-server application using .Net Remoting. From my server I want to return a List in response to a certain method call, however I get an exception saying that basically SoapFormatter cannot deal with generics. I need a workaround so that I am able to work with generics, or direction on how to use XmlSerializer or DataContractSerializer. 回答1: That's cause they didn't add any additional support for the SoapFormatter and generics in .NET 2.0. A quick workaround would be to

.Net Remoting: Indicate which local interface to use to connect to one server

被刻印的时光 ゝ 提交于 2019-12-12 10:35:55
问题 We have a server which we connect with .Net remoting. The server is on two network, the client is on two network. The client and the server have only one network in common: Using discovery, we find the IP of the server(in this case: 10.10.10.110). We create the TcpChannel and we connect to the server. The server receives the calls, but when it tries to send some information to the client sink. we get an exception saying that we tried to send data to an unreacheable IP(10.12.10.100). So the