RO server in a .NET standard DLL

Hey,

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?

Hi,

Can you attach a simple testcase that reproduces this issue, pls?
I think, you didn’t initialize server-side properly.

You can drop testcase to support@ for keeping privacy

Evgeny,

thank you for your reply.

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();
        }
    }
}

Cheers!

Hi,

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.

RodlValidationException: Generated RODL doesn't pass validation. Check Details property for detailed errors list
RemObjects.SDK.Server.ConfigurationWrapper.TryLoad (System.Type[] types, System.Object[] parameters) (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ConfigurationWrapper.Load (System.String applicationName, System.String rodlNamespace) (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ConfigurationLoader.LoadConfiguration (System.Type type) (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ConfigurationLoader.LoadConfiguration () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ConfigurationLoader.Load () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ApplicationServer.LoadApplicationServerConfiguration () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ApplicationServer.RunAsConsoleApplication () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ApplicationServer.RunConsoleApplication () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ApplicationServer.RunOnNetFX () (at <0e84668653194e17a38a68102fc8d943>:0)
RemObjects.SDK.Server.ApplicationServer.Run (System.String[] arguments) (at <0e84668653194e17a38a68102fc8d943>:0)
test.RoServer.Run () (at <e2ec72e91639417c9ef0385472f88cf6>:0)

Hi,

I assume, you don’t have RodlValidationException error , if your project is started as usual .exe with

ApplicationServer server = new ApplicationServer("ROServer4");            
server.Run(args)
return 0;

?

Can you share your project, pls? I’ll review what is wrong

You can drop it to support@ for keeping privacy.

correct.
I sent you an email.

Thanks!

Hi,

try to specify ancestor for your service like

public class Service1 : Service

this is main reason why Service1 cannot be detected as code-first service.

Hi Evgeny,

yes, that was an oversight in the example. But it does not make a difference - the RodlValidationException still occurs when starting the server.