Commands Not Recognized in Telerik.Zip.Extensions
Environment
| Product | Installer and VS Extensions/UI for ASP.NET AJAX |
| Version | Current |
Description
I encountered issues with unrecognized commands when using Telerik.Zip.Extensions. The Telerik.Windows.Zip.Extensions namespace and related commands are not functioning after a library update. The problem occurs while refactoring old code, likely due to changes in namespaces in Telerik Document Processing libraries.
Cause
Starting with Q3 2016, Telerik Document Processing libraries transitioned to platform-agnostic namespaces. As a result, Windows was removed from all namespaces. This change affects namespaces such as Telerik.Windows.Zip.Extensions, which is now Telerik.Zip.Extensions. The assembly and NuGet package names remain unchanged, but the namespaces in code have been updated.
Solution
Update the imports and code to reflect the new namespaces and methods.
Steps
-
Replace the old namespaces with the new platform-agnostic namespaces in all affected files:
Old Namespace New Namespace Telerik.Windows.ZipTelerik.ZipTelerik.Windows.Zip.ExtensionsTelerik.Zip.ExtensionsTelerik.Windows.Documents.*Telerik.Documents.* -
Example of updated imports:
vbImports System.IO Imports Telerik.Zip Imports Telerik.Zip.Extensions -
Update the code to use the correct methods. For example, use the
ExtractToFilemethod on aZipArchiveEntry:vbUsing archive As ZipArchive = ZipArchive.Read(str) For Each entry As ZipArchiveEntry In archive.Entries entry.ExtractToFile( Path.Combine(dxftools.TargetFolder, entry.Name), True, Nothing) Next End UsingExtractToFileis an extension method forZipArchiveEntry.- Ensure the method is used on an entry object and not on
ZipFile.
-
The
ExtractToFilemethod signature:vbExtractToFile( source As ZipArchiveEntry, destinationFileName As String, overwrite As Boolean, timeout As Nullable(Of TimeSpan))