如何更新 Doconut

按照以下步骤从版本 1.0.5.2 或以下进行更新。

.NET Framework 4.7

Web.config 配置

查看器需要通过 web.config 文件注册 HttpHandler。根据您的 IIS 版本,可以使用 web.config 中定义的以下部分来完成注册。

Below IIS 7
<httpHandlers>
  <add verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</httpHandlers>
IIS 7 and above
<handlers>
  <add name="DocImage" verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</handlers>

更新 ASPX 页面中的注册

更改 ASPX 页面中的程序集注册。

Old
<%@ Register Assembly="DocumentViewer" Namespace="DotnetDaddy.DocumentViewer" TagPrefix="asp" %>
New
<%@ Register Assembly="Doconut" Namespace="Doconut" TagPrefix="asp" %>

更新控件标签

将控件标签从 DocViewer 更新为 Viewer。

Old
<asp:DocViewer ID="ctlDoc" runat="server"/>
New
<asp:Viewer ID="ctlDoc" runat="server"/>

更新命名空间

Doconut 24.3.0 重命名了命名空间。添加新的 DLL:Doconut.dll、Doconut.Formats.dll、Doconut.Configs.dll 和 Doconut.Clouds.dll。

New Usings
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;
Initialization
var viewer = new Viewer();

包依赖项

  • Newtonsoft.Json 13.0.3
  • System.Text.Encoding.CodePages 6.0.0
  • System.Text.Json 6.0.0

.NET Standard / Core

更新命名空间

Doconut 24.3.0 重命名了命名空间。添加新的 DLL:Doconut.dll、Doconut.Formats.dll、Doconut.Configs.dll 和 Doconut.Clouds.dll。

New Usings
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;
Initialization
var viewer = new Viewer();

包依赖项

  • Microsoft.Extensions.Caching.Abstractions 3.1.10
  • SkiaSharp 2.88.6
  • Newtonsoft.Json 13.0.3
  • System.Drawing.Common 6.0.0
  • System.Text.Json 6.0.0
  • System.Text.Encoding.CodePages 7.0.0

.NET 6 或更高版本

更新命名空间

Doconut 24.3.0 重命名了命名空间。添加新的 DLL:Doconut.dll、Doconut.Formats.dll、Doconut.Configs.dll 和 Doconut.Clouds.dll。

New Usings
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;
Initialization
var viewer = new Viewer();

包依赖项

  • Microsoft.Extensions.Caching.Abstractions 3.1.10
  • Newtonsoft.Json 13.0.3
  • SkiaSharp 2.88.6
  • System.Drawing.Common 7.0.0
  • System.Text.Encoding.CodePages 7.0.0