Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions deployment/ci-cd-license-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -129,6 +130,25 @@ 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. 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 `<WarningsAsErrors>` 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
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<WarningsAsErrors>TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105</WarningsAsErrors>
</PropertyGroup>
````

* [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

* [Restore Telerik NuGet Packages in CI/CD Workflows](slug:deployment-nuget)
Expand Down
2 changes: 2 additions & 0 deletions installation/license-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down