Labs-Windows icon indicating copy to clipboard operation
Labs-Windows copied to clipboard

Figure out where rogue `Newtonsoft.Json` requirement is coming from

Open michael-hawker opened this issue 2 years ago • 6 comments

It seems like we needed to add a Newtonsoft.Json reference to get our build to work here:

https://github.com/CommunityToolkit/Labs-Windows/blob/566d1e43930171d191c14adfd5a4e276d9a974bd/Common/Labs.Head.props#L9

However, it'd be great not to need this. We should figure out what's causing this and investigate if we can remove it.

FYI @Arlodotexe as I believe you have more of the historical context here.

michael-hawker avatar Mar 28 '22 23:03 michael-hawker

I don't know why it's needed, but removing it cause VS to hang when building the ALL solution

mrlacey avatar May 09 '22 20:05 mrlacey

I wonder if it's some SourceGenerator/VS extension type dependency thing... But that'd be a bit odd. Any ideas @Sergio0694?

@Arlodotexe do you remember when you had to add it what was going on?

michael-hawker avatar May 10 '22 08:05 michael-hawker

I'm actually testing having to add a dependency on this for the unit tests to work for UWP in #126... so maybe that's it. Why this is the case with the refactor vs. the original configuration, I'm not sure. Though we'll see if this works as I expect. Otherwise, I'm not sure what's going on.

michael-hawker avatar May 18 '22 23:05 michael-hawker

This in part may be coming from our Unit Test projects, see https://github.com/microsoft/vstest/issues/2488

michael-hawker avatar May 19 '22 08:05 michael-hawker

@michael-hawker Not sure just by having a quick look, I can say though that it's definitely not the Roslyn projects.

Sergio0694 avatar May 19 '22 09:05 Sergio0694

Alright, I had changed the order of imports which made the reference to UnitTestPlatformVersion invalid, which was messing up the <SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" /> line we had in our Labs.Tests.Uwp.props file.

Because of this, everything still worked, except for this implicit Newtonsoft.Json reference. By correcting the order of the imports and defining this property to make the SDK reference proper, it seems to correct the issue. Tested locally and in the CI.

Applying all these changes uniformly now for #126 for #124.

michael-hawker avatar May 19 '22 21:05 michael-hawker