are there any known limitations to creating an RO server in a class library (.NET standard)?
I created a RO client in a .NET standard class library and am testing it (successfully) in Unity3D with a standalone RODL-based RO server. However, when I put an RODL-based RO server in a .NET standard class library, I get the error “RODL resource not found” in the browser. Next I tried using a code-first server, but the client got the error that no invoker was found. So I connected the client to the server in Visual Studio and recreated the code files with the remoteRODL. The result was dozens of errors that various types (LoginService etc.) were not found in the RemObjects.SDK.Server namespace.
I’m not sure if I’m doing something fundamentally wrong, or if it just can’t work?
To keep it as simple as possible, let’s look at a simple command-line scenario.
There is a template in the RO SDK for Delphi for a simple command line code-first server. Besides creating channel, message and session manager, there are also details regarding the RODL (namespace, library name…)
I haven’t seen such a command-line template for .NET, and the code examples use the ApplicationServer, which I don’t use.
The following code results in
Server Error
**RODL resource not found: TestServerConsole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null**
when accessing http://127.0.0.1:8099/bin in a browser.
What details would need to be added for a functioning command-line code-first server?
namespace TestServerConsole
{
internal class Program
{
static void Main(string[] args)
{
Engine.EventSinkManager = new EventSinkManager();
Engine.MessageQueueManager = new MemoryMessageQueueManager();
Engine.ServiceManager = new ServiceManager();
BinMessage binMessage = new BinMessage();
IpSuperHttpServerChannel channel = new IpSuperHttpServerChannel();
channel.Dispatchers.Add("bin", binMessage);
channel.Port = 8099;
channel.Open();
Console.WriteLine("Server is running - any key to stop");
Console.ReadKey();
}
}
}
I can suggest to use ApplicationServer infrastructure for code-first servers, something like:
ApplicationServer server = new ApplicationServer("ROServer4");
//
// Some optional setup for your server:
//
// TLS
// Create a certificate on first run
// Self-signed certificates are rejected by default so additional code
// might be needed client-side to properly handle them. Please refer to
// https://docs.remotingsdk.com/Clients/Tasks/HandlingSelfSignedCertificates/
// for more details
//server.AutoCreateSelfSignedCertificate = true;
// Enable traffic encryption
//server.NetworkServer.UseTLS = true;
// Optionally, load certificate from file
// or load certificate with provided thumbprint from the system certificate store
// or load certificate from elsewhere and provide it directly
//server.NetworkServer.CertificateFileName = "</path/to/certificate>";
//server.NetworkServer.CertificateThumbprint = "XX XX XX ...";
//server.NetworkServer.Certificate = <certificate instance>
//server.NetworkServer.ServerChannel = new IpSuperHttpServerChannel();
//server.NetworkServer.Port = 8099;
server.Run(new string[] {"--commandline"});
return 0;
That’s the problem - when starting an ApplicationServer from a .NET standard class library in Unity, there is an exception (see below). That’s why I avoid the ApplicationServer stuff and want to create a server from scratch with a plain console app example.
In Unity I am using the RO dlls from the bin\NETStandard folder, as I did for the client.