From 0138ab84b175427817de29b04980d2501e9c55bb Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:02:44 +0300 Subject: [PATCH 1/9] docs(common): Show how to treat license warnings as errors --- deployment/ci-cd-license-key.md | 20 ++++++++++++++++++-- installation/license-key.md | 2 ++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index da83a8036..781e32e57 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -20,8 +20,9 @@ The Telerik license activation process in CI/CD environments involves the follow 1. Go to the [License Keys page](https://www.telerik.com/account/your-licenses/license-keys) in your Telerik account and download your license key. 1. Set an environment variable with either of the following names: - * `TELERIK_LICENSE`—the value must be the Telerik license key string. - * `TELERIK_LICENSE_PATH`—the value must be the full path to the license key file, including the license file name itself. `TELERIK_LICENSE_PATH` requires `Telerik.Licensing` version `1.4.9` and above. You can use it with Telerik UI for Blazor `8.1.0` and above. + * `TELERIK_LICENSE`—the value must be the Telerik license key string. + * `TELERIK_LICENSE_PATH`—the value must be the full path to the license key file, including the license file name itself. `TELERIK_LICENSE_PATH` requires `Telerik.Licensing` version `1.4.9` and above. You can use it with Telerik UI for Blazor `8.1.0` and above. +1. (optional) [Fail the build and deployment](#abort-deployment-on-license-key-error) if there is an issue with the license key. In most cases, the recommended way to provide your license key to the `Telerik.Licensing` NuGet package in CI/CD environments is to use the `TELERIK_LICENSE` environment variable. @@ -129,6 +130,21 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic dotnet publish BlazorProjectName.csproj -c Release -o /app/publish /p:UseAppHost=false ```` +## Abort Deployment on License Key Error + +To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. Add a `` tag to the project file(s) and include the desired [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages): + +>caption Treat Telerik license warnings as errors in the .csproj project file + +````XML.skip-repl + + net8.0 + enable + enable + TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105 + +```` + ## Next Steps * [Restore Telerik NuGet Packages in CI/CD Workflows](slug:deployment-nuget) diff --git a/installation/license-key.md b/installation/license-key.md index 020391359..80744f5c4 100644 --- a/installation/license-key.md +++ b/installation/license-key.md @@ -93,6 +93,8 @@ Scenarios that do not match the above three descriptions result in the following * A watermark appears on Telerik UI for Blazor components. * [A warning message appears in the application's build log](slug:troubleshooting-license-key-errors). +To avoid accidental license watermarks and notifications on your live site, you can [fail the application build and abort deployment](slug:deployment-license-key#abort-deployment-on-license-key-error) when there is an issue with the license key. + ### I updated Telerik UI for Blazor in my app and got license errors. Why? The most likely cause is that the new Telerik UI for Blazor version was released after the expiration date of your current license or license key. To fix this issue: From 8b659af31fbf033d376b4eb70c2e3f6e1b73438c Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:42:54 +0300 Subject: [PATCH 2/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 781e32e57..f03ce165a 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -132,7 +132,7 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic ## Abort Deployment on License Key Error -To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. Add a `` tag to the project file(s) and include the desired [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages): +To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. [Add a `` tag](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors) to the project file(s) and include the desired [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages): >caption Treat Telerik license warnings as errors in the .csproj project file From da7a0a39dfc7e33ae3e89ba912fc69f72973b645 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:34:21 +0300 Subject: [PATCH 3/9] Add second possible syntax --- deployment/ci-cd-license-key.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index f03ce165a..33131d971 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -132,18 +132,22 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic ## Abort Deployment on License Key Error -To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. [Add a `` tag](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors) to the project file(s) and include the desired [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages): - ->caption Treat Telerik license warnings as errors in the .csproj project file +To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) that should be treated as errors: + +* [Add a `` tag to the `.csproj` project file(s)](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors): + ````XML.skip-repl + + net8.0 + enable + enable + TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105 + + ```` -````XML.skip-repl - - net8.0 - enable - enable - TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105 - -```` +* [Set the `-warnaserror` switch when using the .NET CLI](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches): + ````SH.skip-repl + dotnet build -warnaserror:TKL001,TKL002,TKL003,TKL004,TKL101,TKL102,TKL103,TKL104,TKL105 + ```` ## Next Steps From 39681f0163a1fcb722645e5b6dbd0ff64da00b8d Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:46:34 +0300 Subject: [PATCH 4/9] Make syntax more robust --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 33131d971..7cbac4a77 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -146,7 +146,7 @@ To avoid accidental [license watermarks and notifications on your live site](slu * [Set the `-warnaserror` switch when using the .NET CLI](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches): ````SH.skip-repl - dotnet build -warnaserror:TKL001,TKL002,TKL003,TKL004,TKL101,TKL102,TKL103,TKL104,TKL105 + dotnet build -warnaserror:"TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105" ```` ## Next Steps From 8a6fbfefe5829e4b64e0bfd484836ea29c2129f0 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:37:51 +0300 Subject: [PATCH 5/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 7cbac4a77..8f8d7ef53 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -132,7 +132,7 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic ## Abort Deployment on License Key Error -To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) that should be treated as errors: +To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) to be treated as errors: * [Add a `` tag to the `.csproj` project file(s)](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors): ````XML.skip-repl From ac886da46b6c68d70d2b11c72c11dc54f7e81f0c Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:47:06 +0300 Subject: [PATCH 6/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 8f8d7ef53..625edf623 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -144,7 +144,7 @@ To avoid accidental [license watermarks and notifications on your live site](slu ```` -* [Set the `-warnaserror` switch when using the .NET CLI](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches): +* [Set the `-warnaserror` switch](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches) when building with the .NET CLI: ````SH.skip-repl dotnet build -warnaserror:"TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105" ```` From f74c71fadfff74d64a27b154c5f9c80826c23be3 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:47:37 +0300 Subject: [PATCH 7/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 625edf623..cde9c1e58 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -134,7 +134,7 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) to be treated as errors: -* [Add a `` tag to the `.csproj` project file(s)](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors): +* [Add a `` tag](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors) to the `.csproj` project file: ````XML.skip-repl net8.0 From 03dd8918ba9d8c70d6dbf8f0f64f9b6d674d985f Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:47:58 +0300 Subject: [PATCH 8/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index cde9c1e58..1b7debdea 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -132,7 +132,7 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic ## Abort Deployment on License Key Error -To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) to be treated as errors: +To avoid accidental [license watermarks and notifications on your live site](slug:installation-license-key#will-telerik-ui-for-blazor-work-with-an-expired-license-key), you can fail the application build and abort deployment when there is an issue with the license key. There are two alternative ways to list the [Telerik license warning codes](slug:troubleshooting-license-key-errors#error-messages) to be treated as errors: * [Add a `` tag](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors) to the `.csproj` project file: ````XML.skip-repl From 1a7ed12921173c45b3d1841fbcc0c56f332f722c Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Wed, 2 Apr 2025 10:01:35 +0300 Subject: [PATCH 9/9] Update deployment/ci-cd-license-key.md --- deployment/ci-cd-license-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 1b7debdea..09dcda6e2 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -144,7 +144,7 @@ To avoid accidental [license watermarks and notifications on your live site](slu ```` -* [Set the `-warnaserror` switch](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches) when building with the .NET CLI: +* [Set the `-warnaserror` MSBuild switch](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches) in the [`dotnet build` command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build#msbuild): ````SH.skip-repl dotnet build -warnaserror:"TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105" ````