ResolvePackageFileConflicts fails when paths have New Line characters
See original GitHub issueNewLine 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:
- VSFeedback | 484081
- StackOverflow: https://stackoverflow.com/questions/45796041/visual-studio-illegal-characters-in-path
- VSFeedback | 482572
/cc @dsplaisted
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:14 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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?