UserProject)Newtonsoft.Json 7.0.1. (I'll refer to the added package as ToolX)Newtonsoft.Json 8.0.3 to UserProject.UserProjectExecute ToolX.exe in the bin/Debug/... folder of UserProject
ToolX.exe runs as expected
Type load exception for Newtonsoft.Json 7.0.1
There's a binding redirect generated for UserProject.exe but not for the added ToolX.exe. We should be generating a binding redirect file for the added exe in the case that it's being brought into a desktop tfm.
We (ASP.NET team) are building tools that are capable of loading desktop targeting user projects; we do this by referencing the tool once in the tools node and again in the dependencies node. When you run dotnet my-tool it launches the portable version of my-tool which will then build the users project and invoke itself in the built output since it was referenced also in the dependencies node. This is what made the above issue apparent, we were trying to invoke a net451 tool in a user project that targeted a higher version of Newtonsoft.Json.
/cc @DamianEdwards @Eilon @davidfowl @muratg @danroth27 @piotrpMSFT @brthor @natemcmaster @prafullbhosale @pranavkm
@Sridhar-MS will have a fix today.
Fix is in PR, but needs test cases.
@Sridhar-MS can you create an RTM issue to track generating the redirects for publish output?
Fixed by dotnet/cli#2586
Most helpful comment
@Sridhar-MS will have a fix today.