question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ResolvePackageFileConflicts is emitting confusing conflict messages when building .NET 3.5 projects.

See original GitHub issue

Steps to Reproduce

  1. Setup environment with msbuild 15.5 or newer
  2. Create a new .NET 3.5 project
  3. Build - msbuild /t:build

Actual Results The build output indicates there are a bunch of package conflicts

...
Using "ResolvePackageFileConflicts" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll".
Task "ResolvePackageFileConflicts"
  Encountered conflict between 'Platform:System.DirectoryServices.AccountManagement.dll' and 'Platform:System.DirectoryServices.AccountManagement.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Net.dll' and 'Platform:System.Net.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.ComponentModel.DataAnnotations.dll' and 'Platform:System.ComponentModel.DataAnnotations.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Abstractions.dll' and 'Platform:System.Web.Abstractions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Routing.dll' and 'Platform:System.Web.Routing.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.DynamicData.dll' and 'Platform:System.Web.DynamicData.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.DynamicData.Design.dll' and 'Platform:System.Web.DynamicData.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Extensions.Design.dll' and 'Platform:System.Web.Extensions.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Extensions.dll' and 'Platform:System.Web.Extensions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Core.dll' and 'Platform:System.Core.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Conversion.v3.5.dll' and 'Platform:Microsoft.Build.Conversion.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Utilities.v3.5.dll' and 'Platform:Microsoft.Build.Utilities.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Tasks.v3.5.dll' and 'Platform:Microsoft.Build.Tasks.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Engine.dll' and 'Platform:Microsoft.Build.Engine.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Framework.dll' and 'Platform:Microsoft.Build.Framework.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.DataSetExtensions.dll' and 'Platform:System.Data.DataSetExtensions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.AddIn.dll' and 'Platform:System.AddIn.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.AddIn.Contract.dll' and 'Platform:System.AddIn.Contract.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Linq.dll' and 'Platform:System.Data.Linq.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Xml.Linq.dll' and 'Platform:System.Xml.Linq.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Management.Instrumentation.dll' and 'Platform:System.Management.Instrumentation.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.ServiceModel.Web.dll' and 'Platform:System.ServiceModel.Web.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.WorkflowServices.dll' and 'Platform:System.WorkflowServices.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.VisualC.STLCLR.dll' and 'Platform:Microsoft.VisualC.STLCLR.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.VisualC.STLCLR.dll' and 'Platform:Microsoft.VisualC.STLCLR.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Windows.Presentation.dll' and 'Platform:System.Windows.Presentation.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Sentinel.v3.5Client.dll' and 'Platform:Sentinel.v3.5Client.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Entity.dll' and 'Platform:System.Data.Entity.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Entity.Design.dll' and 'Platform:System.Data.Entity.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Entity.dll' and 'Platform:System.Web.Entity.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Entity.Design.dll' and 'Platform:System.Web.Entity.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.dll' and 'Platform:System.Data.Services.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.Client.dll' and 'Platform:System.Data.Services.Client.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.Design.dll' and 'Platform:System.Data.Services.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Engine.dll' and 'Platform:Microsoft.Build.Engine.dll'.  Choosing 'Platform:Microsoft.Build.Engine.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
  Encountered conflict between 'Platform:Microsoft.Build.Framework.dll' and 'Platform:Microsoft.Build.Framework.dll'.  Choosing 'Platform:Microsoft.Build.Framework.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
  Encountered conflict between 'Platform:MSBuild.dll' and 'Platform:MSBuild.dll'.  Choosing 'Platform:MSBuild.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
  Encountered conflict between 'Platform:System.DirectoryServices.AccountManagement.dll' and 'Platform:System.DirectoryServices.AccountManagement.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Net.dll' and 'Platform:System.Net.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.ComponentModel.DataAnnotations.dll' and 'Platform:System.ComponentModel.DataAnnotations.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Abstractions.dll' and 'Platform:System.Web.Abstractions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Routing.dll' and 'Platform:System.Web.Routing.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.DynamicData.dll' and 'Platform:System.Web.DynamicData.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.DynamicData.Design.dll' and 'Platform:System.Web.DynamicData.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Extensions.Design.dll' and 'Platform:System.Web.Extensions.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Extensions.dll' and 'Platform:System.Web.Extensions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Core.dll' and 'Platform:System.Core.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Conversion.v3.5.dll' and 'Platform:Microsoft.Build.Conversion.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Utilities.v3.5.dll' and 'Platform:Microsoft.Build.Utilities.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Tasks.v3.5.dll' and 'Platform:Microsoft.Build.Tasks.v3.5.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Engine.dll' and 'Platform:Microsoft.Build.Engine.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Framework.dll' and 'Platform:Microsoft.Build.Framework.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.DataSetExtensions.dll' and 'Platform:System.Data.DataSetExtensions.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.AddIn.dll' and 'Platform:System.AddIn.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.AddIn.Contract.dll' and 'Platform:System.AddIn.Contract.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Linq.dll' and 'Platform:System.Data.Linq.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Xml.Linq.dll' and 'Platform:System.Xml.Linq.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Management.Instrumentation.dll' and 'Platform:System.Management.Instrumentation.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.ServiceModel.Web.dll' and 'Platform:System.ServiceModel.Web.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.WorkflowServices.dll' and 'Platform:System.WorkflowServices.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.VisualC.STLCLR.dll' and 'Platform:Microsoft.VisualC.STLCLR.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.VisualC.STLCLR.dll' and 'Platform:Microsoft.VisualC.STLCLR.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Windows.Presentation.dll' and 'Platform:System.Windows.Presentation.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Sentinel.v3.5Client.dll' and 'Platform:Sentinel.v3.5Client.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Entity.dll' and 'Platform:System.Data.Entity.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Entity.Design.dll' and 'Platform:System.Data.Entity.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Entity.dll' and 'Platform:System.Web.Entity.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Web.Entity.Design.dll' and 'Platform:System.Web.Entity.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.dll' and 'Platform:System.Data.Services.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.Client.dll' and 'Platform:System.Data.Services.Client.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:System.Data.Services.Design.dll' and 'Platform:System.Data.Services.Design.dll'.  Could not determine winner due to equal file and assembly versions.
  Encountered conflict between 'Platform:Microsoft.Build.Engine.dll' and 'Platform:Microsoft.Build.Engine.dll'.  Choosing 'Platform:Microsoft.Build.Engine.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
  Encountered conflict between 'Platform:Microsoft.Build.Framework.dll' and 'Platform:Microsoft.Build.Framework.dll'.  Choosing 'Platform:Microsoft.Build.Framework.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
  Encountered conflict between 'Platform:MSBuild.dll' and 'Platform:MSBuild.dll'.  Choosing 'Platform:MSBuild.dll' because AssemblyVersion '3.5.0.0' is greater than '2.0.0.0'.
Done executing task "ResolvePackageFileConflicts".
...

Expected Results

  1. The conflict message itself it confusing. The message doesn’t indicate what the source of the two “platform” conflicts are. I wouldn’t expect the platform to have conflicts within itself.
  2. The conflict messages are the majority of the output. I would expect that the build output of a new empty project with the default verbosity would be pretty simple and understandable.

Notes of Interest:

  1. This appears to be a behavior change introduced in 15.5. The 15.4 output does not include these conflicts.
  2. The diagnostic output indicates the following TargetFrameworkDirectories are detected
  Task Parameter:
      TargetFrameworkDirectories=
          C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\
          C:\Windows\Microsoft.NET\Framework\v3.5\
          "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\"
          C:\Windows\Microsoft.NET\Framework\v3.0\
          C:\Windows\Microsoft.NET\Framework\v2.0.50727\ (TaskId:8)
  1. The C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\RedistList\FrameworkList.xml includes multiple entries for most assemblies.
...
  <File AssemblyName="System.Core" Version="3.5.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGAC="false" />
  <File AssemblyName="System.Core" Version="3.5.0.0" PublicKeyToken="b77a5c561934e089" Culture="neutral" ProcessorArchitecture="MSIL" InGAC="true" />
...

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
JoachimRaue-EHcommented, Oct 14, 2019

Any news on this? The bug is open for almost two years… I am also struggling with megabytes worth of useless log entries.

1reaction
rschindhelm-habacommented, Mar 6, 2019

We’ve encountered this on our TFS 2018 CI builds when building a .NET Framework application which uses .NET Standard libraries, using the Visual Studio Build task (MSBuild).

Excerpt:

2019-03-06T07:11:21.1661481Z _HandlePackageFileConflicts:
2019-03-06T07:11:21.1661481Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL' and 'Reference:System.Runtime.InteropServices.RuntimeInformation'.  NETSDK1033: Choosing 'Reference:System.Runtime.InteropServices.RuntimeInformation' because AssemblyVersion '4.0.2.0' is greater than '4.0.1.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
2019-03-06T07:11:21.1661481Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL' and 'Reference:System.IO.Compression.ZipFile'.  NETSDK1033: Choosing 'Reference:System.IO.Compression.ZipFile' because AssemblyVersion '4.0.3.0' is greater than '4.0.2.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
2019-03-06T07:11:21.1974031Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL' and 'Platform:Microsoft.Build.Framework.dll'.  NETSDK1033: Choosing 'Reference:Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL' because AssemblyVersion '15.1.0.0' is greater than '4.0.0.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
2019-03-06T07:11:21.1974031Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.IO.Compression' and 'Platform:System.IO.Compression.dll'.  NETSDK1033: Choosing 'Reference:System.IO.Compression' because AssemblyVersion '4.2.0.0' is greater than '4.0.0.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
2019-03-06T07:11:21.1974031Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.Net.Http' and 'Platform:System.Net.Http.dll'.  NETSDK1033: Choosing 'Reference:System.Net.Http' because AssemblyVersion '4.2.0.0' is greater than '4.0.0.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
2019-03-06T07:11:21.1974031Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.Collections' and 'Platform:System.Collections.dll'.  NETSDK1033: Choosing 'Reference:System.Collections' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'. [c:\agent\_work\8\s\src\SampleProject\src\DotNetFullFrameworkApplication.csproj]
Read more comments on GitHub >

github_iconTop Results From Across the Web

ResolvePackageFileConflicts is emitting confusing conflict ...
ResolvePackageFileConflicts is emitting confusing conflict messages when building .NET 3.5 projects. · Steps to Reproduce 1. Setup environment ...
Read more >
Roslyn error only with .NET Core
I've managed to reproduce this while loading Nodatime with a .Net Core 3.1 project. In order to solve it you can add the...
Read more >
Untitled
NET 3.5 project Build - msbuild /t:build The conflict message itself it confusing. The message doesn't indicate what the source of the two...
Read more >
ResolvePackageFileConflicts task could not be loaded ...
The "ResolvePackageFileConflicts" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found