Skip to content

Commit

Permalink
re-enable BinaryFormatter tests, fixes dotnet#103447 (dotnet#104104)
Browse files Browse the repository at this point in the history
* re-enable BinaryFormatter tests, fixes dotnet#103447

* don't run BF tests on WASM and Mobile
  • Loading branch information
adamsitnik authored Jun 28, 2024
1 parent 8a3e603 commit 952a14d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
<MicrosoftDiaSymReaderVersion>2.0.0</MicrosoftDiaSymReaderVersion>
<MicrosoftDiaSymReaderNativeVersion>17.10.0-beta1.24272.1</MicrosoftDiaSymReaderNativeVersion>
<SystemCommandLineVersion>2.0.0-beta4.23407.1</SystemCommandLineVersion>
<!-- This package provides working implementation of BinaryFormatter and is used only by test projects -->
<SystemRuntimeSerializationFormattersVersion>9.0.0-preview.7.24327.2</SystemRuntimeSerializationFormattersVersion>
<TraceEventVersion>3.1.7</TraceEventVersion>
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
<NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ private static bool DetermineBinaryFormatterSupport()
{
return true;
}
else if (IsNativeAot)
else if (IsNativeAot || IsBrowser || IsMobile)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
</PropertyGroup>

<ItemGroup>
<!-- TODO 103447: These tests all require BinaryFormatter, which won't work until there's a published NuGet package.
<Compile Include="**\*.cs" />
-->
</ItemGroup>

<ItemGroup>
Expand All @@ -40,6 +38,7 @@
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<ProjectReference Include="..\..\src\System.Resources.Extensions.csproj" />
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonVersion)" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common.TestData" Version="$(SystemDrawingCommonTestDataVersion)" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
<ProjectReference Include="..\..\src\System.Resources.Extensions.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonVersion)" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Windows.Extensions\src\System.Windows.Extensions.csproj" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Expand Down

0 comments on commit 952a14d

Please sign in to comment.