From b60a2fa48b15ab33e98b453cdf005fcf7a8981e8 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 da83a80361..781e32e57f 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 0203913592..80744f5c49 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 72e0b48f0bc224a13b4a414eed2a413ebf6b4bfc 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 781e32e57f..f03ce165ac 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 481f58a002de1f8a708e62eea98e88ea47ea7bf5 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 f03ce165ac..33131d9712 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 37ab6d4bfefc5b0462b1212c7ee9d75840061dbc 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 33131d9712..7cbac4a773 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 473ff0c778251625fc52aa496b69fe1c2224214d 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 7cbac4a773..8f8d7ef53b 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 0246a9a686521ccce88109e6fe5da7f8e62f1948 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 8f8d7ef53b..625edf6233 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 e0069f0878ffc2967000f6cdb5e293c7e6cf9168 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 625edf6233..cde9c1e58b 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 399c0d4c5009bab7c9958b654ad49a1135ec0152 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 cde9c1e58b..1b7debdeac 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 e0305cb1fb1e28124b7b2756b5b1f429d59018d5 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 1b7debdeac..09dcda6e2c 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" ````