איך לעדכן את Doconut
עקבו אחרי הצעדים האלה כדי לעדכן מגרסה 1.0.5.2 ומטה.
.NET מסגרת 4.7
קונפיגורציית Web.config
הצופה דורש רישום HttpHandler דרך קובץ web.config. בהתאם לגרסת IIS שלכם ניתן לבצע זאת באמצעות הקטע הבא המוגדר ב‑web.config.
מתחת ל‑IIS 7:
<httpHandlers>
<add verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</httpHandlers>IIS 7 ומעלה:
<handlers>
<add name="DocImage" verb="GET,POST" path="DocImage.axd" type="Doconut.DocImageHandler, Doconut" />
</handlers>עדכון רישום בדפי ASPX
שנו את רישום האסמבלי בדפי ASPX שלכם.
ישן:
<%@ Register Assembly="DocumentViewer" Namespace="DotnetDaddy.DocumentViewer" TagPrefix="asp" %>חדש:
<%@ Register Assembly="Doconut" Namespace="Doconut" TagPrefix="asp" %>עדכון תגית הבקר
עדכנו את תגית הבקר מ‑DocViewer ל‑Viewer.
ישן:
<asp:DocViewer ID="ctlDoc" runat="server"/>חדש:
<asp:Viewer ID="ctlDoc" runat="server"/>עדכון מרחבי שמות
Doconut 24.3.0 שינה את מרחבי השמות. הוסיפו את קבצי ה‑DLL החדשים: Doconut.dll, Doconut.Formats.dll, Doconut.Configs.dll, ו‑Doconut.Clouds.dll.
Using חדשים:
using Doconut;
using Doconut.Configs;
using Doconut.Clouds;אתחול:
var viewer = new Viewer();תלותי חבילות
- חבילה Newtonsoft.Json 13.0.3
- חבילה System.Text.Encoding.CodePages 6.0.0
- חבילה System.Text.Json 6.0.0
.NET סטנדרד / ליבה
עדכון מרחבי שמות
Doconut 24.3.0 שינה את מרחבי השמות. הוסיפו את קבצי ה‑DLL החדשים: Doconut.dll, Doconut.Formats.dll, Doconut.Configs.dll, ו‑Doconut.Clouds.dll.
Using חדשים:
using Doconut;
using Doconut.Configs;
using Doconut.Clouds;אתחול:
using System;
// מופעי Viewer מתקבלים כעת ממפעל, DI container, או מספק אחר.
// החלף את המימוש של GetViewer בלוגיקה האמיתית שלך לרכישה.
Viewer GetViewer() => throw new NotImplementedException();
var viewer = GetViewer(); // קבל מופע 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.
Using חדשים:
// השתלבות נוכחית של .NET 6: Viewer מגיע מ‑DI ופתיחת המסמך היא אסינכרונית.
var token = await viewer.OpenDocumentAsync(path, new PdfConfig { AllowSearch = true });אתחול:
app.MapPost("/api/open", async (Viewer viewer) =>
{
// הטוקן הוא אטום — העבר אותו ל‑widget, לעולם אל תתעד או תשמר אותו.
string token = await viewer.OpenDocumentAsync("wwwroot/files/Sample.pdf");
return Results.Ok(new { token });
});תלותי חבילות
- חבילה 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
האם דף זה היה מועיל?