Skip to content

Commit e6428f4

Browse files
committed
add SystemCollectionsImmutableVersion
1 parent ebbfd2a commit e6428f4

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/fsc/fsc.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
</ItemGroup>
5252

5353
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
54+
<!-- SCI 10.x net462 build has assembly version 10.0.0.2, but FCS (netstandard2.0) references 10.0.0.0.
55+
A direct ref ensures binding redirect generation bridges the mismatch on .NET Framework. -->
56+
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
5457
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
5558
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafeVersion)" />
5659
</ItemGroup>

tests/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
<DebugType>portable</DebugType>
88
</PropertyGroup>
99

10+
<!-- SCI 10.x has mismatched assembly versions between net462 (10.0.0.2) and netstandard2.0 (10.0.0.0).
11+
A direct ref ensures binding redirect generation bridges this on .NET Framework test runners. -->
12+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
13+
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
14+
</ItemGroup>
15+
1016
<!-- xUnit3 packages for all test projects (except Test.Utilities which is a library) -->
1117
<ItemGroup Condition="($(MSBuildProjectName.EndsWith('.Tests')) OR $(MSBuildProjectName.EndsWith('.ComponentTests')) OR $(MSBuildProjectName.EndsWith('.UnitTests'))) AND '$(ExcludeFromTestPackageReferences)' != 'true'">
1218
<PackageReference Include="xunit.v3.mtp-v2" Version="$(XunitVersion)" />

tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
100100
</ItemGroup>
101101
<PropertyGroup>
102-
<NoWarn>$(NoWarn);NU1510;44</NoWarn> <!-- NU1510: Project is explicitly referencing the runtime assembly 'System.Collections.Immutable', however, if we remove it, it tries to find it on the wrong path. Also, local NoWarn does not help - This is just me trying to enforce it -->
102+
<NoWarn>$(NoWarn);NU1510;NU1504;44</NoWarn> <!-- NU1510: Project is explicitly referencing the runtime assembly 'System.Collections.Immutable', however, if we remove it, it tries to find it on the wrong path. Also, local NoWarn does not help - This is just me trying to enforce it -->
103+
<!-- NU1504: Duplicate PackageReference for System.Collections.Immutable — one from tests/Directory.Build.props (net472 binding redirect fix) and one here for GeneratePathProperty. -->
103104
<!-- 44: AssemblyName.CodeBase is deprecated but needed for assembly resolution in VS integration tests -->
104105
</PropertyGroup>
105106
<ItemGroup>

vsintegration/tests/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@
1515
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
1616
</PropertyGroup>
1717

18+
<!-- SCI 10.x has mismatched assembly versions between net462 (10.0.0.2) and netstandard2.0 (10.0.0.0).
19+
A direct ref ensures binding redirect generation bridges this on .NET Framework test runners. -->
20+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
21+
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
22+
</ItemGroup>
23+
1824
</Project>

0 commit comments

Comments
 (0)