설치
Doconut을 .NET Standard 2.1 프로젝트에 추가
.NET Standard용 기본 Doconut 뷰어는 ASP.NET Core 애플리케이션에 연결할 수 있는 단일 NuGet 패키지로 제공됩니다. 선택적 플러그인은 별도 패키지를 사용합니다. 이 페이지에서는 기본 패키지를 설치하고, 호스트가 이를 사용할 수 있는지 확인한 뒤, 미들웨어를 등록합니다 — 첫 번째 렌더링을 수행하기 전에 필요한 최소 단계입니다.
먼저 호스트 프레임워크 확인
The library targets netstandard2.1. That is a narrower contract than the previous netstandard2.0 build, and it is the first thing to verify:
| 호스트 | 지원 여부 |
|---|---|
| .NET Core 3.0 이상, .NET 5/6/7/8 포함 | 예 |
| .NET Framework (모든 버전) | 아니오 — netstandard2.1은 .NET Framework에서 사용할 수 없습니다 |
If the application runs on .NET Framework, this is not the right package. Use Doconut.NETFramework instead; from 26.9.0 it requires .NET Framework 4.7.2. The reference applications shipped with this release target net8.0.
패키지 설치
dotnet add package Doconut.NETStandardThe unversioned command installs the latest stable release. To reproduce the current 26.8.0 release exactly, pass the version as a separate option:
dotnet add package Doconut.NETStandard --version 26.8.0Doconut.NETStandard is the package ID. The .26.8.0 suffix belongs to the downloaded Doconut.NETStandard.26.8.0.nupkg filename and is not part of the ID.
버전 번호는 세대를 나타냅니다
This matters more here than the package name. Both generations of the .NET Standard library publish under the same package ID, and only the version tells them apart:
| 버전 | 대상 | API |
|---|---|---|
| 26.7.0 이하 | netstandard2.0 | the previous integration |
| 26.8.0 이상 | netstandard2.1 | the integration documented here |
There is no compatibility shim and no side-by-side package. Bumping the version is the upgrade, and the compiler will report the API differences immediately.
Do not select documentation from the package name alone:
new Viewer(_cache, _accessor, …),UnSafeMode, 동기OpenDocument(...),viewer.InitCache(),UseDoconutWebFarm, 및 수동으로 복사된 뷰어 스크립트는 이전 통합을 식별합니다;AddDoconut(),UseDoconutResources(), 주입된Viewer, 및OpenDocumentAsync(...)는 여기 문서화된 현재 통합을 식별합니다.
The translated 이전 설정 매뉴얼 remains available. Use the 마이그레이션 가이드 to change generations; a package update does not convert startup, viewer lifetime, or browser resources automatically.
Doconut 등록
AddDoconut() is the only registration entry point — there is a single overload, and it wires the Viewer service, the license service, and the rendering infrastructure into the DI container.
Two middleware calls complete the setup, and their order matters: UseDoconutResources() must run before UseDoconut(). UseDoconut() is terminal middleware, so calling it first means every request to a /doconut-res asset never reaches the resources handler and 404s. The session wiring is required too — Doconut's default document security validates every page request against ASP.NET session state.
builder.Services.AddDoconut(options =>
{
options.LicensePath = "Doconut.Viewer.lic";
});
builder.Services.AddDistributedMemoryCache(); // 세션 상태에 캐시가 필요합니다 (MVC/Razor Pages가 이미 하나를 추가합니다)
builder.Services.AddSession(); // Doconut 문서 보안은 ASP.NET 세션 상태에 의존합니다
app.UseSession(); // UseSession()을 UseDoconut()보다 먼저 호출합니다
app.UseDoconutResources(); // UseDoconut()보다 먼저 등록되어야 합니다
app.UseDoconut();네임스페이스
The configuration types are no longer spread across four namespaces. In this release almost everything lives in the root Doconut namespace:
using Doconut; // Viewer, DoconutOptions, DocOptions, 모든 포맷 설정
using Doconut.Middleware; // AddDoconut, UseDoconut, UseDoconutResources
using Doconut.Clouds; // 클라우드 및 파일 공유 설정
using Doconut.Configs.Conversion; // ConversionTargetThe type names themselves did not change — PdfConfig, WordConfig, ExcelConfig, CssConfig, ScriptConfig 등은 그대로 존재합니다. 기존 애플리케이션을 옮기는 경우 대부분의 파일에서 using 라인 두 개만 삭제하면 됩니다; 자세한 내용은 마이그레이션 가이드를 참고하십시오.
모든 옵션
DoconutOptions accepts the following settable properties. Every one is optional — the defaults below apply when a property is left unset.
| 속성 | 기본값 | 설명 |
|---|---|---|
ShowDoconutInfo | false | true일 경우, token이 없는 요청에 404 대신 버전 배너를 반환합니다. 간단한 확인용으로 유용하며, 프로덕션에서는 비활성화하십시오. |
UnsafeMode | false | true일 경우, 페이지 요청 시 ASP.NET 세션 보안 검사를 건너뜁니다. 프로덕션에서는 비활성화하십시오. 철자에 유의하세요 — 이전 라이브러리에서는 UnSafeMode라고 불렀습니다. |
MiddlewarePath | "/doconut" | 페이지‑이미지 엔드포인트의 조정 값입니다. 검증은 되지만 자체적으로 브랜치를 마운트하지는 않으므로 실제 UseDoconut() 매핑 및 클라이언트 BasePath와 일치하도록 유지하십시오. |
ResourcesPath | "/doconut-res" | 임베디드 JS/CSS/이미지 리소스가 제공되는 경로입니다. |
LicensePath | "" (empty string) | 라이선스 파일 경로입니다. 빈 문자열이면 다음 소스로 넘어가 자동 검색을 시도합니다. |
LicenseContent | "" (empty string) | 원시 라이선스 내용 — 환경 변수, 비밀 관리자, 데이터베이스 등에서 가져옵니다. |
LicenseStream | null | 시작 시 한 번 읽는 스트림 형태의 라이선스입니다. |
ResetLicense | false | 예약된 호환성 플래그입니다. 라이선스는 AddDoconut() 중에 읽히며, 라이선스를 교체한 후 앱을 재시작하십시오. |
License precedence when more than one source is set: LicenseStream beats LicenseContent beats LicensePath beats auto-search — see 라이선스 설정.
builder.Services.AddDoconut(options =>
{
options.LicensePath = "Doconut.Viewer.lic";
options.MiddlewarePath = "/doconut"; // 앱 매핑 및 클라이언트 BasePath와 조정
options.ResourcesPath = "/doconut-res"; // 뷰어의 JS/CSS/이미지가 제공되는 위치
options.UnsafeMode = false; // 세션 보안을 유지
options.ShowDoconutInfo = false;
});다음 단계
이 페이지가 도움이 되었나요?