From 307b1bab58a47d4422de8718f1ff91922837cd98 Mon Sep 17 00:00:00 2001 From: dmitry-t-aspos <106818227+dmitry-t-aspos@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:19:09 +0200 Subject: [PATCH] =?UTF-8?q?Added=20description=20to=20documentation=20for?= =?UTF-8?q?=20using=20embedded=20=E2=80=A6=20(#74)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added description to documentation for using embedded license * Updated license file name --------- Co-authored-by: Vladimir Litvinchik <35294201+vladimir-litvinchik@users.noreply.github.com> --- .../licensing-and-subscription.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/net/getting-started/licensing-and-subscription.md b/net/getting-started/licensing-and-subscription.md index ed5e343..f67d5ee 100644 --- a/net/getting-started/licensing-and-subscription.md +++ b/net/getting-started/licensing-and-subscription.md @@ -36,7 +36,7 @@ Licenses can be applied from different locations: * The folder containing the assembly that called _GroupDocs.Viewer.dll_ * The folder containing the entry assembly (your _.exe_) * As a Metered License that allows you to pay for your usage. For details, see the [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered/). - +* As embedded resource When you reference _GroupDocs.Viewer.dll_ in the application, the library is copied to your output directory (unless **Copy Local** in the properties for that entry is set to false). The easiest way to set a license is often to place the license file in the same folder as _GroupDocs.Viewer.dll_ and specify just the filename without the path. Use the [SetLicense](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/license/setlicense/) method to license a component. @@ -110,6 +110,25 @@ Console.WriteLine("Credits consumed: " + creditsConsumed); {{< /tab >}} {{< /tabs >}} +#### Apply License from embedded resource + +You can set license as embedded resource as an alternative to license file. This is a convenient way because you need just add a license to the project and specify the license name in the SetLicense method, without thinking about the full paths to this file +{{< alert style="info" >}} + +Before using embedded license it should be added to project, and in properties of this file set "Build action" to "Embedded Resource". Make sure that license name in embedded resources and string argument in SetLicense method are same + +{{< /alert >}} +The following code snippet shows how to use the embedded license: + +{{< tabs "example4">}} +{{< tab "C#" >}} +```csharp +License license = new License(); +license.SetLicense("GroupDocs.Viewer.lic"); +``` +{{< /tab >}} +{{< /tabs >}} + ### Changing the License File Name You do not have to name the license file "GroupDocs.Viewer.lic". Feel free to rename it as you prefer, and use that name when setting the license in your application.