Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions NET/Mbc.Pcs.Net.DataRecorder.Test/FileRingBufferTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ namespace Mbc.Pcs.Net.Test.DataRecorder
{
public class FileRingBufferTest
{
public FileRingBufferTest()
{
#if NET8_0_OR_GREATER
// Enable BinaryFormatter, because in .NET 8.0 it is disabled by default
AppContext.SetSwitch("System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization", true);
#endif
}

[Fact]
public void SmokeTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Product>Mbc.Pcs.Net.DataRecorder.Test</Product>

<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<EnableUnsafeBinaryFormatterSerialization Condition="'$(TargetFramework)' == 'net8.0'">true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
<PropertyGroup>
<NoWarn>NU1702;CS7022</NoWarn>
Expand All @@ -23,6 +24,9 @@
<!--Requires the HDF package reference to find the hdf5.dll-->
<PackageReference Include="HDF.PInvoke" Version="1.10.6.1" Condition="'$(TargetFramework)' == 'net471' OR '$(TargetFramework)' == 'net48'" />
<PackageReference Include="HDF.PInvoke.1.10" Version="1.10.610" Condition="'$(TargetFramework)' == 'netstandard2.0' " />

<!--Use NuGet package for BinaryFormatter on .NET 8.0-->
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="10.0.1" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion NET/Mbc.Pcs.Net.DataRecorder/Mbc.Pcs.Net.DataRecorder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<Product>Mbc.Pcs.Net.DataRecorder</Product>

<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeBinaryFormatterSerialization Condition="'$(TargetFramework)' != 'net8.0'">true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
<PropertyGroup>
<NoWarn>NU1702</NoWarn>
Expand All @@ -16,5 +16,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mbc.Hdf5Utils" Version="0.7.0" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="10.0.1" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>
</Project>