Skip to content

Commit b06113a

Browse files
authored
Merge pull request #14991 from tamasvajk/standalone/prefer-assembly-version-over-netcore-version
C#: Prefer assembly version over netcore version in conflict resolution
2 parents 6dd941e + 267125a commit b06113a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/AssemblyCacheExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class AssemblyCacheExtensions
99
private static readonly Version emptyVersion = new Version(0, 0, 0, 0);
1010

1111
/// <summary>
12-
/// This method orders AssemblyInfos by version numbers (.net core version first, then assembly version). Finally, it orders by filename to make the order deterministic.
12+
/// This method orders AssemblyInfos. The method is used to define the assembly preference order in case of conflicts.
1313
/// </summary>
1414
public static IOrderedEnumerable<AssemblyInfo> OrderAssemblyInfosByPreference(this IEnumerable<AssemblyInfo> assemblies, IEnumerable<string> frameworkPaths)
1515
{
@@ -21,8 +21,8 @@ public static IOrderedEnumerable<AssemblyInfo> OrderAssemblyInfosByPreference(th
2121
: assemblies.OrderBy(initialOrdering);
2222

2323
return ordered
24-
.ThenBy(info => info.NetCoreVersion ?? emptyVersion)
2524
.ThenBy(info => info.Version ?? emptyVersion)
25+
.ThenBy(info => info.NetCoreVersion ?? emptyVersion)
2626
.ThenBy(info => info.Filename);
2727
}
2828
}

csharp/ql/integration-tests/posix-only/standalone_dependencies/Assemblies.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| /avalara.avatax/21.10.0/lib/netstandard20/Avalara.AvaTax.netstandard20.dll |
22
| /microsoft.bcl.asyncinterfaces/6.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll |
3+
| /microsoft.netcore.app.ref/3.1.0/ref/netcoreapp3.1/System.Data.DataSetExtensions.dll |
34
| /microsoft.netcore.app.ref/3.1.0/ref/netcoreapp3.1/System.Runtime.InteropServices.WindowsRuntime.dll |
45
| /microsoft.netcore.app.ref/6.0.13/ref/net6.0/System.Data.dll |
56
| /microsoft.netcore.app.ref/6.0.13/ref/net6.0/System.Xml.dll |
@@ -26,7 +27,6 @@
2627
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Console.dll |
2728
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Core.dll |
2829
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Data.Common.dll |
29-
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Data.DataSetExtensions.dll |
3030
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.Contracts.dll |
3131
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.Debug.dll |
3232
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.DiagnosticSource.dll |

csharp/ql/integration-tests/windows-only/standalone_dependencies/Assemblies.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| /avalara.avatax/21.10.0/lib/netstandard20/Avalara.AvaTax.netstandard20.dll |
22
| /microsoft.bcl.asyncinterfaces/6.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll |
3+
| /microsoft.netcore.app.ref/3.1.0/ref/netcoreapp3.1/System.Data.DataSetExtensions.dll |
34
| /microsoft.netcore.app.ref/3.1.0/ref/netcoreapp3.1/System.Runtime.InteropServices.WindowsRuntime.dll |
45
| /microsoft.netcore.app.ref/6.0.13/ref/net6.0/System.Data.dll |
56
| /microsoft.netcore.app.ref/6.0.13/ref/net6.0/System.Xml.dll |
@@ -25,7 +26,6 @@
2526
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Console.dll |
2627
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Core.dll |
2728
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Data.Common.dll |
28-
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Data.DataSetExtensions.dll |
2929
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.Contracts.dll |
3030
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.Debug.dll |
3131
| /microsoft.netcore.app.ref/7.0.2/ref/net7.0/System.Diagnostics.DiagnosticSource.dll |

0 commit comments

Comments
 (0)