2

I'm building a .NET 6.0 application that needs to use CORBA and IIOP to communicate with a remote server.

To achieve this, i'm using IIOP.NET, which depends on the deprecated Remoting API, and because of that i'm getting this exception when initializing the library:

System.TypeLoadException: 'Could not load type 'System.Runtime.Remoting.Channels.IChannelSender' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'

Is there any way i can make the assembly load correctly in .NET 6?

I've tried to manually link the System.Runtime.Remoting dll in the application, but that doesn't seem to work.

burnsi
  • 6,194
  • 13
  • 17
  • 27
Albardo
  • 31
  • 1
  • 2
    You can't. .NET 6 is .NET *Core* 6, a cross-platform runtime. .NET 6 doesn't have Remoting at all and even WCF, which replaced Remoting 18 years ago, is a community supported project now, CoreWCF – Panagiotis Kanavos Feb 01 '23 at 17:15
  • 2
    Short answer: no. Longer answer: even if you could somehow get this to work in .NET 6 with some amount of black magic, it would undoubtedly stop working again in a future version, as more and more bits of binary serialization and remoting get phased out with each new release of .NET. Either move away from this implementation altogether, or leave the relevant bits as a .NET Framework application that you puppeteer using IPC -- but not remoting, obviously, rather something supported by .NET Core like gRPC. – Jeroen Mostert Feb 01 '23 at 17:15
  • See also here: https://stackoverflow.com/questions/70005465/can-i-add-a-reference-to-a-net-framework-dll-from-a-net-6-project – Klaus Gütter Feb 01 '23 at 17:17
  • 2
    `needs to use CORBA and IIOP` those are ancient and language-specific protocols. Even Java programs no longer user them. Are you **absolutely** sure you need RMI and CORBA? Doesn't the server support a more modern protocol like SOAP, REST, gRPC? CORBA itself is a specification that must be implemented by a server. Are you sure that server still requires CORBA ? – Panagiotis Kanavos Feb 01 '23 at 17:20
  • Besides, which assembly are you loading? Where did it come from? If it's a commercial product the vendor may have an updated version that doesn't require .NET Remoting – Panagiotis Kanavos Feb 01 '23 at 17:27
  • I know it's an old protocol, but unfortunately the server uses only supports CORBA so I'm forced to use it as well. Anyways, I think I'll try the intermediate application approach for now and if it works well enough I'll stick to it. – Albardo Feb 03 '23 at 13:09

0 Answers0