如何更新 Doconut

按照以下步骤将版本 1.0.5.2 或以下更新。

.NET Framework 4.7

Web.config 配置

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

IIS 7 以下:

xml
<httpHandlers>
  <add verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</httpHandlers>

IIS 7 及以上:

xml
<handlers>
  <add name="DocImage" verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</handlers>

在 ASPX 页面中更新注册

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

旧:

aspx
<%@ Register Assembly="DocumentViewer" Namespace="DotnetDaddy.DocumentViewer" TagPrefix="asp" %>

新:

aspx
<%@ Register Assembly="Doconut" Namespace="Doconut" TagPrefix="asp" %>

更新控件标签

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

旧:

aspx
<asp:DocViewer ID="ctlDoc" runat="server"/>

新:

aspx
<asp:Viewer ID="ctlDoc" runat="server"/>

更新命名空间

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

新的 using:

csharp
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;

初始化:

csharp
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。

新的 using:

csharp
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;

初始化:

csharp
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 or higher

更新命名空间

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

新的 using:

csharp
using Doconut;
using Doconut.Configs;
using Doconut.Formats;
using Doconut.Clouds;

初始化:

csharp
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

此页面有帮助吗?