microsoft / microsoft/AdaptiveCards

[AdaptiveCards.Templating] Package Downgrade Error due to Newtonsoft.Json via AdaptiveExpressions

Open
#8,053 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

The simplest possible project referencing this library fails to compile:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net6.0</TargetFramework>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="AdaptiveCards.Templating" Version="1.3.1" />
	</ItemGroup>
</Project>

The error:

Error NU1605 Detected package downgrade: Newtonsoft.Json from 12.0.3 to 11.0.2. Reference the package directly from the project to select a different version.
AdaptiveCardTemplateRepro -> AdaptiveCards.Templating 1.3.1 -> AdaptiveExpressions 4.11.2 -> Newtonsoft.Json (>= 12.0.3)
AdaptiveCardTemplateRepro -> AdaptiveCards.Templating 1.3.1 -> Newtonsoft.Json (>= 11.0.2)

Tested using Visual Studio 2022 17.4.0.

Workaround

Add reference to Newtonsoft.Json:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net6.0</TargetFramework>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="AdaptiveCards.Templating" Version="1.3.1" />
		<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
	</ItemGroup>
</Project>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the package dependency metadata for AdaptiveCards.Templating 1.3.1 and its AdaptiveExpressions 4.11.2 dependency. Reproduce the NU1605 error with the minimal net6.0 project, then verify that a corrected dependency declaration restores the project without requiring a direct Newtonsoft.Json workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.