0

I'm trying to use moon-apns in my .NET core 1 project. However, when I moved the required files over to my project, it looks like sslStream no long has BeginRead(). The version of sslStream in the moon-apns project has this at the top of the sslStream.cs file:

#region Assembly System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Where as the sslStream.cs file in my project has:

#region Assembly System.Net.Security, Version=4.0.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Joel Coehoorn
  • 362,140
  • 107
  • 528
  • 764
user6728767
  • 803
  • 2
  • 11
  • 23
  • `BeginRead` is inherited from `System.IO.Stream`. It isn't displayed as an actual member. – Dai Apr 16 '18 at 20:28
  • Are you targeting .NET Core / DNX / Xamarin or some other target? You can't use the .NET Framework's DLLs, this may be the reason your `SslStream` class (from the wrong assembly) can't find `System.IO.Stream` and its inherited members (like `BeginRead`). – Dai Apr 16 '18 at 20:30
  • Oh that might be why. I think this project i'm trying to reference is targeted towards .net40 or .net45 whereas mine is .net core 1. Is that going to be an issue? – user6728767 Apr 16 '18 at 20:31
  • Is there an alternative to BeginRead in .NET Core? – user6728767 Apr 16 '18 at 20:33
  • 1
    .NET Core 1.x does not have `Stream.BeginRead` but it was added in .NET Core 2.0 ( https://docs.microsoft.com/en-gb/dotnet/api/system.io.stream.beginread ). I'm curious why you're targeting .NET Core 1 because it's largely obsolete. However you should consider using `ReadAsync` instead. – Dai Apr 16 '18 at 20:38
  • I was tasked with taking over this project. The original developer used .NET Core 1.0 for some reason. I tried migrating to .NET Core2.0, but wasn't able to do it successfully. – user6728767 Apr 16 '18 at 20:42

0 Answers0