.NET core RO client for .NET FW RO server - unexpected EOF or 0 bytes

I have a .NET FW 4.7.2 code base but I wanted to make a .NET core 8 client

There is an issue when calling the RO server functions.
I assume making a connection from .NET core to .NET FW should work
This is the error I get

It is a HTTPS server
serverROHTTP_ = new RemObjects.SDK.Server.ApplicationServer(“ServiceBroker”, serviceTypes);
// Enable traffic encryption
serverROHTTP_.AutoCreateSelfSignedCertificate = false;
serverROHTTP_.NetworkServer.UseTLS = true;
serverROHTTP_.NetworkServer.Certificate = new System.Security.Cryptography.X509Certificates.X509Certificate2(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, “wildcard_officinall_be.pfx”), “”);
serverROHTTP_.NetworkServer.ServerChannel = new RemObjects.SDK.Server.IpHttpServerChannel();

The server links with RO v10.0.0.1553 from
C:\Program Files (x86)\RemObjects Software\RemObjects SDK for .NET\Bin\RemObjects.SDK.dll
‘OffServiceBroker.exe’ (CLR v4.0.30319: OffServiceBroker.exe): Loaded ‘C:\WINDOWS\assembly\GAC_MSIL\RemObjects.SDK\10.0.0.1553__3df3cad1b7aa5098\RemObjects.SDK.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.

The client links with nuget assembly v10.0.0.1553
C:\Users\admin.nuget\packages\remobjects.sdk\10.0.0.1553\lib\netcoreapp3.1\RemObjects.SDK.dll
‘CentralManagement.exe’ (CoreCLR: clrhost): Loaded ‘E:\p4\main\Source.NET\module\CentralManagement\bin\Debug\net8.0-windows7.0\RemObjects.SDK.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.

Any idea what causes this issue?
Does the call stack help to determine what exactly causes the issue.

FWIW< this is not a general error. thr wire protocol for RO clients and servers is the same between all platform, and I use a mix od Classic .NET and .NET Core in several of mown projects w.o issues. We’ll need to investigate hats actually going wrong.

To start, can yu share the full, uncrossed exception callstack?

Also, are you on the latest version of Remoting SDK? IIRC .NET Core 7 (or 8) had a breaking change in its Socket implementation for SSL that required a workaround on our side; that workaround shipped forever-ago, though (December last year).

Essentially, if I recall, fir first call to DataSocket.Receive to receive data got broke to return 0 (which used to be and is officially the way to signal the end of the connection), but on .NET Core 8 that “just happens”.

This sounds like it may be related.

Hi, I am on version 10.0.0.1553, do I need to upgrade?
BTW: I already use RO .NET core with TCP RO .NET FW services without any issue.
So it is indeed related to HTTPS/SSL

Hi,

this fix was added in 10.0.0.1579 so you need to upgrade

2 Likes

Hello, switching to the latest RO/DA SDK indeed solves the issue
Thanks

Note:
Is it correct that functionality has moved since v1553?

I replaced
fileSchema.Serialization.LoadFromFile(fname);
by
fileSchema.LoadFromFile(fname);
for var fileSchema = new RemObjects.DataAbstract.Schema.ServiceSchema();

Is this correct?

An additional question:
To fix this we have reverted from using nuget packages and gone back to a dll reference in program files.
Is this the advised way?
FYI: At present I am on a beta version 1597.
What gets published on nuget?
I only see version 1553 (which had the issue)

Hi,

yes, this is correct.


select RemObjects Software in this combo box:

Regarding the breaking change in the code:
Is there a compiler define we can use to have code that builds for both the RO SDK versions?
Something like
#if REMOBJECT_V10_0_0_1553
fileSchema.Serialization.LoadFromFile(fname);
#else
fileSchema.LoadFromFile(fname);
#endif

We have a codebase with utility .csproj’s which are used in multiple projects.
Some developers haven’t switched to the newest RO SDK yet.
How can we have code that builds for both SDKs

Hi,

You can add this extension class to projects that use the newest build:

  MySchema = public extension class(RemObjects.DataAbstract.Schema.Schema)
  public
    property Serialization: RemObjects.DataAbstract.Xml.SerializableObject read self;
  end;

Compiler defines don’t work like that in NET, you cannot “export” a define like that from a third-party assembly (though you can of course set iy , yourself). If you are using Elements, you can use the #if exists (that’s C#, or `{$IF EXISTS…} in Oxygene) though, to conditionally compile based on whether a certain API is available, e.g.

#if exists("fileSchema.Serialization.LoadFromFile")
fileSchema.Serialization.LoadFromFile(fname);
#else
fileSchema.LoadFromFile(fname);
#endif