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 fails when paths have New Line characters

See original GitHub issue

NewLine characters in HintPaths are causing an exception in ResolvePackageFileConflicts for projects that previously worked. E.g.

<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <HintPath>
      ..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
      </HintPath>
</Reference>

StackTrace:

The "ResolvePackageFileConflicts" task failed unexpectedly.
System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.GetFileName(String path)
   at Microsoft.NET.Build.Tasks.ItemUtilities.GetTargetPath(ITaskItem item)
   at Microsoft.NET.Build.Tasks.ItemUtilities.GetReferenceTargetPath(ITaskItem item)
   at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.<>c.<ExecuteCore>b__35_1(ConflictItem ci)
   at Microsoft.NET.Build.Tasks.ConflictResolution.ConflictResolver`1.ResolveConflicts(IEnumerable`1 conflictItems, Func`2 getItemKey, Action`1 foundConflict, Boolean commitWinner, Action`1 unresolvedConflict)
   at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	Services (Services\Services)			

Reports:

/cc @dsplaisted

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ceddlyburgecommented, Sep 5, 2017

Projects like this used to work and now don’t, so I think it will be causing people pain.

If it is desired behaviour, then maybe an improved error message would be a decent compromise?

This could detail the reference that has the problem, which would be a big help while fixing up.

1reaction
livarcocccommented, Feb 12, 2018

@wli3 this seems simple enough. I will mark it for 2.1.3xx, any chance you can get this in in between your other stuff?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio- Illegal characters in path
Error The "ResolvePackageFileConflicts" task failed unexpectedly. System.ArgumentException: Illegal characters in path. at System.IO.Path.
Read more >
C# – Visual Studio- Illegal characters in path
Then when I run build I get: Error The "ResolvePackageFileConflicts" task failed unexpectedly. System.ArgumentException: Illegal characters in path.
Read more >
resolvepackagefileconflicts does not resolve solution wide ...
The solution has multiple C# library assemblies and a single application. The assermblies are loosly coupled behing interfaces and some are Assembly.Load(path) ...
Read more >
[Solved]-Visual Studio- Illegal characters in path-C#
I noticed the issue happening when any reference in the .csproj file has a Hintpath. After using Notepad to remove the Hintpath from...
Read more >
ResolvePackageFileConflicts task could not be loaded ...
6 I am unable to build several class library projects in my solution. They all fail with the same error: The "ResolvePackageFileConflicts" task ......
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