hikalkan / scs

TCP Server/Client Communication and RMI Framework
MIT License
225 stars 112 forks source link

.NET8 Support - The BinaryFormatter type is dangerous and is not recommended for data processing. #45

Open downmuss opened 1 month ago

downmuss commented 1 month ago

Hello, do you have any plan to update this TCP Connector to .NET8

im trying to "Fix" this issue on .NET8 but can't complete, i try with Protobuf to Serialize and Deserialize messages.

Type is not expected, and no contract can be inferred: Scs.Framework.Communication.ScsServices.Communication.Messages.ScsRemoteInvokeMessage

downmuss commented 1 month ago

To "Add" support for .NET8 this is a Trick

Add into your .csproj and Scs.dll .csproj this line

true

This is my ScsNet8.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
    <AssemblyName>Scs</AssemblyName>
    <RootNamespace>Hik</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="protobuf-net" Version="3.2.30" />
  </ItemGroup>

</Project>