Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Microsoft.CodeAnalysis.Analyzer.Testing nuget package dependencies for downstream clients #1025

Merged
merged 3 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.CodeAnalysis.Testing/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

<!-- Needed to override the transitive 9.0.1 version brought in by the 16.1.1 Microsoft.NET.Test.Sdk -->
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" ExcludeAssets="all" />
</ItemGroup>

<!-- Use a different versioning scheme for nuget packages -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</When>
<Otherwise>
<PropertyGroup>
<NuGetApiVersion>5.6.0</NuGetApiVersion>
<NuGetApiVersion>6.3.0</NuGetApiVersion>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for the right runtime assemblies to be discovered.

</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
2 changes: 1 addition & 1 deletion tests/Microsoft.CodeAnalysis.Testing/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<TestTargetFrameworks>netcoreapp3.1;net472;net46</TestTargetFrameworks>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forcing the Newtonsoft.Json version means that net46 will find the wrong assemblies at runtime in this repo. We will get flagged if we have tests that use a Newtonsoft.Json version that is older than 13.0.1. I don't have any good ideas on how to solve this problem other than to remove the TFM from our test suite.

<TestTargetFrameworks>netcoreapp3.1;net472</TestTargetFrameworks>
<SourceGeneratorTestTargetFrameworks>netcoreapp3.1;net472</SourceGeneratorTestTargetFrameworks>

<!-- Workaround dependencies that do not yet support netcoreapp3.1 https://github.com/dotnet/roslyn/issues/45114 -->
Expand Down