Control Deployment

Webforms

UnoViewer library's deployment is pretty straight forward. In your Visual Studio solution add reference to the below mentioned DLLs.

Uno.Files.Viewer.dll
Uno.Files.Extentions.dll
Uno.Files.Options.dll

Copy the unoViewer folder to the website's root path as shown in the image. This folder consists of the required stylesheets, images, language, themes, menus and the UnoViewer license file UnoViewer.xml.licx.

Define following handler in your web.config file.

  <system.webServer>
    <handlers>
      <add name="UnoImage" verb="GET,POST" path="UnoImage.axd" 
      type="Uno.Files.Viewer.UnoImageHandler, Uno.Files.Viewer" />
    </handlers>
  </system.webServer>
You can specify a custom location be providing a appSetting value in the web.config named UnoViewerLicensePath. Important: Right click the license file in Visual Studio, open its properties and set the build action to "None".

MVC / Razor

For .NET 6.0 please add reference to the below mentioned DLLs.

Uno.Files.Viewer.Net.6.0.dll
Uno.Files.Extensions.Net.6.0.dll
Uno.Files.Options.Net.Standard.2.0.dll

For .NET Standard.

Uno.Files.Viewer.Net.Standard.2.0.dll
Uno.Files.Extensions.Net.Standard.2.0.dll
Uno.Files.Options.Net.Standard.2.0.dll

Copy the unoViewer folder to the website's root path as above. Declare the following middleware in your Program.cs file.

app.MapWhen(context => context.Request.Path.ToString().EndsWith("UnoImage.axd"),
    appBranch =>
    {
        appBranch.UseUnoViewer(new UnoViewOptions { UnSafe = false, ShowInfo = false });
    }
);

Nuget References

Please right click your project in Visual Studio and click "Edit Project File". Then paste below ItemGroup of PackageReference. This will automatically download and add these references, please follow the instructions on screen.

<ItemGroup>
 <PackageReference Include="bblanchon.PDFium.Win32" Version="130.0.6721" />
 <PackageReference Include="HarfBuzzSharp" Version="8.3.1.1" />
 <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
 <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
 <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.2" />
 <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
 <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
 <PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
 <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
 <PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
 <PackageReference Include="SkiaSharp" Version="3.119.0" />
 <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.0" />
 <PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="3.119.0" />
 <PackageReference Include="System.Buffers" Version="4.5.1" />
 <PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
 <PackageReference Include="System.ComponentModel" Version="4.3.0" />
 <PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
 <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
 <PackageReference Include="System.Memory" Version="4.5.5" />
 <PackageReference Include="System.Net.Requests" Version="4.3.0" />
 <PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.0" />
 <PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
 <PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
 <PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.7.0" />
 <PackageReference Include="System.Security.Permissions" Version="4.7.0" />
 <PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
 <PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
</ItemGroup>

// For Docker / Linux
// Replace

<PackageReference Include="bblanchon.PDFium.Win32" Version="130.0.6721" />

// With 

<PackageReference Include="bblanchon.PDFium.Linux" Version="141.0.7388" />

Blazor (Server)

For Blazor the deployment is similar to .NET MVC Razor. Just enable WebSocket Protocol on your web server.

Web Server (IIS)
       Web Server
            Application Development
                WebSocket Protocol

Summary

We hope that you found the deployment part pretty simple and straight forward. You can download our samples for more information and a live demo.