kerryjiang / WebSocket4Net

A popular .NET WebSocket Client
Apache License 2.0
764 stars 273 forks source link

.NET Standard 2.0 #131

Open breyed opened 6 years ago

breyed commented 6 years ago

Currently, adding the WebSocket4Net NuGet package to a project running on the .NET Framework causes several System.*.dll files to be created in the output directory. These files are redundant with the similar files in the GAC. They are slower because they must be deployed, are not pre-jitted, and are not likely to be already loaded into memory by another process.

Updating the DLL and NuGet package to target .NET Standard 2.0 would avoid these problems. The package would continue to work on downlevel platforms, such as .NET 4.5, as long as no dependencies on features specific to later releases are introduced.

kerryjiang commented 6 years ago

Great, I'll work on it.

kerryjiang commented 6 years ago

Which version of .NET Framework do you use?

I don't have this problem if I set .NET 4.6 as my project's target.

Probably multiple targets cause this problem?

breyed commented 6 years ago

I'm using a new-style project (initial element is <Project Sdk="Microsoft.NET.Sdk">), with <TargetFramework>net46</TargetFramework>. It references WebSocket4Net with this:

<PackageReference Include="WebSocket4Net" Version="0.15.2" />

Some of the other assemblies that the project depends on (not related to WebSocket4Net) have <TargetFrameworks>netstandard2.0;net46</TargetFrameworks>.

wollkopf commented 6 years ago

Any updates on this topic?

lorenzo93 commented 6 years ago

Me too following the topic. Can't wait to see the support for .NET Standard 2.0!

yiev commented 5 years ago

Any updates on this?

kerryjiang commented 5 years ago

It is on the way: https://github.com/kerryjiang/SuperSocket/tree/master/src/SuperSocket.WebSocket

WebSocket4Net should be base on SuperSocket.WebSocket. That means server side and client side share the same protocol implementation.

aleksandargasevic commented 4 years ago

Any update on supporting Net Standard 2.0? I want to include it in my Core 2.2 project

kerryjiang commented 4 years ago

Actually there is already a .net core version in NuGet: https://www.nuget.org/packages/WebSocket4Net/0.15.2

Which targets .netstandard 1.3 which is compatible with .NET Core 2.2 and .net standard 2.0.

The one I mentioned base on SuperSocket.WebSocket is a complete brand new implementation.

aleksandargasevic commented 4 years ago

Net Core 2.0 and 2.2 are only compatible with Net standard 2.0.

This project targets Net Standard 1.3 only, it's only compatible with Net core 1.0

Correct me if I wrong.

https://docs.microsoft.com/en-us/dotnet/standard/net-standard

kerryjiang commented 4 years ago

I don't think so. The project targets high standard can reference the libraries which target to lower .netstandard.

.NET implementation support The following table lists the minimum platform versions that support each .NET Standard version. That means that later versions of a listed platform also support the corresponding .NET Standard version. For example, .NET Core 2.2 supports .NET Standard 2.0 and earlier.