Version Conflict Detected for Telerik.Zip
Environment
Product | UI for Blazor Telerik Document Processing |
Description
Visual Studio and the .NET SDK throw an error if incompatible versions of Telerik UI for Blazor and Telerik Document Processing are used in the same project.
Error Message
Error NU1107: Version conflict detected for Telerik.Zip. Install/reference Telerik.Zip ... directly to project ... to resolve this issue.
or
Warning NU1605: Detected package downgrade: Telerik.Zip from ... to .... Reference the package directly from the project to select a different version.
Cause
Telerik.Zip
is a transitive dependency of multiple other Telerik NuGet packages:
- Telerik UI for Blazor (the
Telerik.UI.for.Blazor
NuGet package) depends on theTelerik.Documents.SpreadsheetStreaming
NuGet package in order to support Grid Excel export.Telerik.Documents.SpreadsheetStreaming
depends onTelerik.Zip
. - Most Telerik Document Processing NuGet packages depend on
Telerik.Documents.Core
, which also depends onTelerik.Zip
.
Telerik UI for Blazor and Telerik Document Processing use different release cycles. As a result, the latest version of Telerik UI for Blazor may not be compatible with the latest version of Telerik Document Processing.
Error NU1107 Version conflict detected for Telerik.Zip
occurs when an older Telerik UI for Blazor version is used together with a newer Telerik Document Processing version. As a result, Telerik.UI.for.Blazor
expects an older Telerik.Zip
version than what the project has resolved.
Warning NU1605 Detected package downgrade: Telerik.Zip
occurs when a newer Telerik UI for Blazor version is used together with a older Telerik Document Processing version. As a result, Telerik.UI.for.Blazor
expects a newer Telerik.Zip
version than what the project has resolved.
Solution
There are several ways to fix the NuGet conflict errors:
- Upgrade Telerik UI for Blazor, if a newer version is available.
- Downgrade Telerik Document Processing to the older version that
Telerik.UI.for.Blazor
expects forTelerik.Zip
. - Reference the newer version of
Telerik.Zip
explicitly in the project. - Reference the newer version of
Telerik.Documents.SpreadsheetStreaming
explicitly in the project.
The ultimate goal is all Telerik NuGet packages in the app to use the same version of Telerik.Zip
.
Upgrade or Downgrade NuGet Package Versions
- Refer to the release notes for your Telerik UI for Blazor version.
- Check the required and compatible version of Telerik Document Processing. For example, Telerik UI for Blazor 6.2.0 depends on Telerik Document Processing 2024.3.806.
- Upgrade Telerik UI for Blazor. Alternatively, downgrade Telerik Document Processing.
Reference the Telerik.Zip Package Explicitly
Register the newer Telerik.Zip
NuGet package version explicitly in the project, which will force Telerik UI for Blazor to use that version instead. The referenced Telerik.Zip
version must match the version of the other Telerik Document Processing packages in the project. The resulting output in the .csproj
file will be similar to the one below.
<ItemGroup>
<PackageReference Include="Telerik.UI.for.Blazor" Version="AA.BB.CC" />
<PackageReference Include="Telerik.Zip" Version="ZZ.YY.XX" />
<PackageReference Include="Telerik.Documents.Spreadsheet" Version="ZZ.YY.XX" />
<PackageReference Include="Telerik.Documents.Spreadsheet.FormatProviders.OpenXml" Version="ZZ.YY.XX" />
</ItemGroup>
This approach will generate a NuGet Warning NU1608, but the application will be able to compile and run.
NU1608: Detected package version outside of dependency constraint: Telerik.Documents.SpreadsheetStreaming ... requires Telerik.Zip ... but version Telerik.Zip ... was resolved.
Reference the Telerik.Documents.SpreadsheetStreaming Package Explicitly
Register the newer Telerik.Documents.SpreadsheetStreaming
NuGet package version explicitly in the project, which will force Telerik UI for Blazor to use that version instead. The referenced Telerik.Documents.SpreadsheetStreaming
version must match the version of the other Telerik Document Processing packages in the project. The resulting output in the .csproj
file will be similar to the one below.
<ItemGroup>
<PackageReference Include="Telerik.UI.for.Blazor" Version="AA.BB.CC" />
<PackageReference Include="Telerik.Documents.SpreadsheetStreaming" Version="ZZ.YY.XX" />
<PackageReference Include="Telerik.Documents.Spreadsheet" Version="ZZ.YY.XX" />
<PackageReference Include="Telerik.Documents.Spreadsheet.FormatProviders.OpenXml" Version="ZZ.YY.XX" />
</ItemGroup>