File size: 3,177 Bytes
090629c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--

***********************************************************************************************

Microsoft.NET.Build.Extensions.ConflictResolution.targets



WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have

          created a backup copy.  Incorrect changes to this file will make it

          impossible to load or build your projects from the command-line or the IDE.



Copyright (c) .NET Foundation. All rights reserved.

***********************************************************************************************

-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup Condition="'$(DisableHandlePackageFileConflicts)' != 'true'">
    <!-- Non-SDK using project.json or PackageReference, run after references are read from the lock/assets file -->
    <_HandlePackageFileConflictsAfter>ResolveNuGetPackageAssets</_HandlePackageFileConflictsAfter>

    <!-- In case ResolveNuGetPackageAssets is not run (eg: packages.config), ensure we run before targets that consume references -->
    <_HandlePackageFileConflictsBefore>ResolveAssemblyReferences</_HandlePackageFileConflictsBefore>
  </PropertyGroup>

  <Import Project="Microsoft.NET.DefaultPackageConflictOverrides.targets" />

  <UsingTask TaskName="ResolvePackageFileConflicts" AssemblyFile="$(MicrosoftNETBuildExtensionsTasksAssembly)" />
  <Target Name="_HandlePackageFileConflicts"

          BeforeTargets="$(_HandlePackageFileConflictsBefore)"

          AfterTargets="$(_HandlePackageFileConflictsAfter)"

          DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"

          Condition="'@(Reference)' != '' Or '@(ReferenceCopyLocalPaths)' != ''">
    <ResolvePackageFileConflicts References="@(Reference)"

                                 ReferenceCopyLocalPaths="@(ReferenceCopyLocalPaths)"

                                 PlatformManifests="@(PackageConflictPlatformManifests)"

                                 TargetFrameworkDirectories="$(TargetFrameworkDirectory)"

                                 PackageOverrides="@(PackageConflictOverrides)"

                                 PreferredPackages="$(PackageConflictPreferredPackages)">
      <Output TaskParameter="ReferencesWithoutConflicts" ItemName="_ReferencesWithoutConflicts" />
      <Output TaskParameter="ReferenceCopyLocalPathsWithoutConflicts" ItemName="_ReferenceCopyLocalPathsWithoutConflicts" />
      <Output TaskParameter="Conflicts" ItemName="_ConflictPackageFiles" />
    </ResolvePackageFileConflicts>

    <!-- Replace Reference / ReferenceCopyLocalPaths with the filtered lists.

         We must remove all and include rather than just remove since removal is based

         only on ItemSpec and duplicate ItemSpecs may exist with different metadata

         (eg: HintPath) -->
    <ItemGroup>
      <Reference Remove="@(Reference)" />
      <Reference Include="@(_ReferencesWithoutConflicts)" />
      <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
      <ReferenceCopyLocalPaths Include="@(_ReferenceCopyLocalPathsWithoutConflicts)" />
    </ItemGroup>
  </Target>
</Project>