Unable to install 26.9.0 in .Net Framework project

When trying to install the NuGet package i receive the following error.

Could not install package ‘Microsoft.AspNetCore.WebUtilities 10.0.12’. You are trying to install this package into a project that targets ‘.NETFramework,Version=v4.8.1’, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

There are no versions of Microsoft.AspNetCore.WebUtilities that target the .NET Framework.

Hi @mdkucera,

Thanks for the detailed report.

The short answer is NuGet is selecting a newer version of one of Doconut’s dependencies that is compatible only with .NET 10.

Please see Section 2 below for the recommended installation steps.

One important note before updating: Doconut.NETFramework 26.9.0 introduces a new API generation, so some migration changes may be required. See Section 4 for details.


1) Why this happens

Doconut.NETFramework 26.9.0 requires Microsoft.AspNetCore.WebUtilities version 2.2.0 or later.

Doconut does not reference this package directly; the dependency comes through Microsoft.AspNetCore.Http.

Versions 2.2.0 and 2.3.x of Microsoft.AspNetCore.WebUtilities target .NET Standard 2.0 and are therefore compatible with .NET Framework 4.8.1.

Normally, NuGet installs the lowest version that satisfies the dependency requirement, which in this case is 2.2.0.

However, if NuGet is configured to select the highest available version, it currently resolves the dependency to Microsoft.AspNetCore.WebUtilities 10.0.12. That version targets .NET 10 only, which causes the installation error you are seeing.

Microsoft.Net.Http.Headers has the same versioning situation and would normally be the next package to fail.

This behavior can be caused by one of the following:

  • The Dependency behavior option in Visual Studio’s NuGet Package Manager being set to Highest.
  • A dependencyVersion entry in a NuGet.Config file.
  • Updating all NuGet packages at once.

2) How to install Doconut 26.9.0

From the Package Manager Console, run:

Update-Package Doconut.NETFramework -Version 26.9.0 -DependencyVersion Lowest

Alternatively, from the Visual Studio NuGet Package Manager:

  1. Select the Doconut.NETFramework package.
  2. Expand Options in the right-hand panel.
  3. Set Dependency behavior to Lowest.
  4. Run the update again.

You should also check whether a NuGet.Config file in your solution or user profile contains:

<add key="dependencyVersion" value="Highest" />

If so, that setting is causing NuGet to select the incompatible 10.x dependencies.


3) Prevent this from happening again

To prevent a future Update All operation from upgrading these dependencies to 10.x, you can add allowedVersions to the corresponding entries in packages.config:

<package id="Microsoft.AspNetCore.WebUtilities"
         version="2.2.0"
         targetFramework="net481"
         allowedVersions="[2.2,3)" />

<package id="Microsoft.Net.Http.Headers"
         version="2.2.0"
         targetFramework="net481"
         allowedVersions="[2.2,3)" />

This keeps those dependencies within the compatible 2.x range.

We are also preparing an updated Doconut.NETFramework NuGet package that will include a fix for this dependency resolution issue, so the manual dependency configuration described above should no longer be necessary. We expect to publish this update within the next few days.


4) Before updating: Doconut 26.9.0 introduces a new API

Doconut.NETFramework 26.9.0 is the first release of a new generation of the .NET Framework package and introduces a different API.

After updating, you should therefore expect some compile-time errors that will need to be adjusted as part of the migration.

For packages.config projects, the update also removes the old DocImage handler from Web.config.

Please review the migration guide carefully, as it documents all required changes. It also includes some changes to the client-side viewer that may not produce compile-time errors, so they are important to review even if the project builds successfully.

The installation and migration documentation is available here:

https://doconut.com/en/support/documentation/net-472/getting-started/installation


5) Example projects

Our monthly release email for Doconut 26.9.0 should also include a link to download the updated example projects.

If you did not receive the email or do not have access to the examples, you can request them here:

https://doconut.com/en/request-examples

We recommend reviewing the examples alongside the migration documentation, as they show the new 26.9.0 API and project configuration in a complete working application.