VS 2017.NET Core BinaryFormatter

Are VS 2017 BinaryFormatter tools released in the .NET Framework? When I create the .NET Core console application, I cannot find the BinaryFormatter. There are many Nuget packages, but which one is the right one to get a working BinaryFormatter with .NET Core?

By the way, it’s a little awkward to create a project with Visual Studio that doesn’t compile. I need to run the cmd shell where my .NET Core console application is located, and

dotnet restore 

to make it compile. Did I miss the VS command in the links menu?

Edit1

Using Install-Package BinaryFormatter gives me an exception

 PM> Install-Package BinaryFormatter Restoring packages for d:\source\vc17\NetCoreApp\ConsoleApp1\ConsoleApp2\ConsoleApp2.csproj... Install-Package : Package BinaryFormatter 1.0.2 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package BinaryFormatter 1.0.2 supports: - dnx451 (DNX,Version=v4.5.1) - dnxcore50 (DNXCore,Version=v5.0) At line:1 char:1 + Install-Package BinaryFormatter + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand Install-Package : One or more packages are incompatible with .NETCoreApp,Version=v1.1. At line:1 char:1 + Install-Package BinaryFormatter + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand Install-Package : Package restore failed. Rolling back package changes for 'ConsoleApp2'. At line:1 char:1 + Install-Package BinaryFormatter + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand 
+7
c # visual-studio-2017 .net-core
source share
1 answer

Here is the nuget package that says it also supports the kernel:

 Install-Package BinaryFormatter 

I'm not sure if this contains what you need, but System.Runtime.Serialization.Formatters is also

 Install-Package System.Runtime.Serialization.Formatters 

These packages work with. Net-Core 1.0, so that they can work with the environment 1.1, you will need cross-matching, you can refer to this main question

+6
source share

All Articles