# RO server in a .NET standard DLL

**URL:** https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277
**Category:** Remoting SDK
**Tags:** net
**Created:** [January 10, 2025, 5:11am UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277 "2025-01-10T05:11:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![BernhardFischer](https://talk.remobjects.com/user_avatar/talk.remobjects.com/bernhardfischer/32/621_2.png) [@BernhardFischer](https://talk.remobjects.com/u/BernhardFischer)
#### Post date: [January 10, 2025, 5:11am UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/1 "2025-01-10T05:11:52Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [January 10, 2025, 8:20am UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/2 "2025-01-10T08:20:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![BernhardFischer](https://talk.remobjects.com/user_avatar/talk.remobjects.com/bernhardfischer/32/621_2.png) [@BernhardFischer](https://talk.remobjects.com/u/BernhardFischer)
#### Post date: [January 10, 2025, 4:55pm UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/3 "2025-01-10T16:55:16Z")

</div>

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

```auto
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](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?

```auto
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!

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [January 13, 2025, 7:00am UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/4 "2025-01-13T07:00:07Z")

</div>

Hi,

I can suggest to use `ApplicationServer` infrastructure for code-first servers, something like:

```cs
            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;

```

---

<div class="post-metadata">

### Author: ![BernhardFischer](https://talk.remobjects.com/user_avatar/talk.remobjects.com/bernhardfischer/32/621_2.png) [@BernhardFischer](https://talk.remobjects.com/u/BernhardFischer)
#### Post date: [January 13, 2025, 1:16pm UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/5 "2025-01-13T13:16:07Z")

</div>

> [@EvgenyK](#):
>
> I can suggest to use `ApplicationServer` infrastructure for code-first servers, something like:

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.

```auto
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)

```

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [January 13, 2025, 2:12pm UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/6 "2025-01-13T14:12:16Z")

</div>

Hi,

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

```auto
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.

---

<div class="post-metadata">

### Author: ![BernhardFischer](https://talk.remobjects.com/user_avatar/talk.remobjects.com/bernhardfischer/32/621_2.png) [@BernhardFischer](https://talk.remobjects.com/u/BernhardFischer)
#### Post date: [January 13, 2025, 3:14pm UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/7 "2025-01-13T15:14:47Z")

</div>

> [@EvgenyK](#):
>
> I assume, you don’t have `RodlValidationException` error , if your project is started as usual .exe

correct.  
I sent you an email.

Thanks!

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [January 14, 2025, 7:42am UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/8 "2025-01-14T07:42:42Z")

</div>

Hi,

try to specify ancestor for your service like

```auto
public class Service1 : Service

```

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

---

<div class="post-metadata">

### Author: ![BernhardFischer](https://talk.remobjects.com/user_avatar/talk.remobjects.com/bernhardfischer/32/621_2.png) [@BernhardFischer](https://talk.remobjects.com/u/BernhardFischer)
#### Post date: [January 14, 2025, 12:11pm UTC](https://talk.remobjects.com/t/ro-server-in-a-net-standard-dll/31277/9 "2025-01-14T12:11:05Z")

</div>

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.
