Skip to content

SocketLite throws exception on start with UWP Net Native Toolchain compilation #25

@kelly987654

Description

@kelly987654

Issue:
I'm attempting to use the SocketLite libraries for a Xamarin Forms UWP application. Everything works fine in the Debug/Release builds of the application with the 'Compile with .NET Native tool chain' setting turned off, but when the setting is turned on, an exception is thrown by the TcpSocketListener on the call to CreateObservableListener.

image

.NET Native tool chain setting (UWP Project -> Properties -> Build)
image

Exceptions (unfortunately I don't have a more helpful exception message):
Unhandled exception at 0x75D364A1 (combase.dll) in XF.TestApp.UWP.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x15065888, 0x00000001).

Unhandled exception at 0x75C7A2B9 (combase.dll) in XF.TestApp.UWP.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.

Steps to reproduce:

  1. Create a test Xamarin Forms project containing a UWP project
  2. Install the SocketLite Nuget package in the Portable and UWP Projects
  3. Add code to the portable implementation to start a TcpSocketListener.
  4. Switch to release mode ('Compile with .NET Native tool chain' setting is on by default) and start the app => exception is thrown on CreateObservableListener
  5. Uncheck 'Compile with .NET Native tool chain' setting and redeploy the app => no exception

Versions used:

  • SocketLite: 5.0.1
  • Microsoft.NetCore.UniversalWindowsPlatform: 6.1.7
  • System.Reactive...: 4.0.0
  • Xamarin.Forms: 3.1.0.637273
  • Portable projects using Net Standard 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions