Skip to content

Issue when AOT enabled #298

Description

@berik-99

I start by giving a big thank you to the creator of the library for all the hard work done so far and to all the contributors!

I tried to use the new AOT publishing feature, but I encountered some problems:

First Problem

The client execution stops with a NullReferenceException when calling the Connect() method, which obviously halts the execution.
the stack trace is:

System.NullReferenceException: 'Object reference not set to an instance of an object.'
   at WatsonTcp.WatsonTcpClient.Connect()
   at Program.<Main>$(String[] args)

Steps to reproduce:

  1. Create a Console Application project with AOT disabled and copy the server example from the README.
  2. Create a second Console Application project with AOT enabled, and copy the client example from the README.
  3. Start the server first, then the client.

Second Problem

The server seems to work initially, but when a client connects, it is immediately disconnected without any direct exceptions on either side, although two exceptions are logged in the server application's debug console:

Exception thrown: 'System.InvalidOperationException' in System.Text.Json.dll
Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll

Steps to reproduce:

  1. Create a Console Application project with AOT enabled and copy the server example from the README.
  2. Create a second Console Application project with AOT disabled, and copy the client example from the README.
  3. Start the server first, then the client.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions