Skip to content

Commit b0d2a2d

Browse files
Merge license-fail-2885 into production (#2888)
* docs(common): Show how to treat license warnings as errors * Update deployment/ci-cd-license-key.md * Add second possible syntax * Make syntax more robust * Update deployment/ci-cd-license-key.md * Update deployment/ci-cd-license-key.md * Update deployment/ci-cd-license-key.md * Update deployment/ci-cd-license-key.md * Update deployment/ci-cd-license-key.md --------- Co-authored-by: Dimo Dimov <[email protected]>
1 parent 42ee7df commit b0d2a2d

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

deployment/ci-cd-license-key.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ The Telerik license activation process in CI/CD environments involves the follow
2020

2121
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.
2222
1. Set an environment variable with either of the following names:
23-
* `TELERIK_LICENSE`&mdash;the value must be the Telerik license key string.
24-
* `TELERIK_LICENSE_PATH`&mdash;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.
23+
* `TELERIK_LICENSE`&mdash;the value must be the Telerik license key string.
24+
* `TELERIK_LICENSE_PATH`&mdash;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.
25+
1. (optional) [Fail the build and deployment](#abort-deployment-on-license-key-error) if there is an issue with the license key.
2526

2627
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.
2728

@@ -129,6 +130,25 @@ Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the artic
129130
dotnet publish BlazorProjectName.csproj -c Release -o /app/publish /p:UseAppHost=false
130131
````
131132
133+
## Abort Deployment on License Key Error
134+
135+
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:
136+
137+
* [Add a `<WarningsAsErrors>` tag](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warningsaserrors-and-warningsnotaserrors) to the `.csproj` project file:
138+
````XML.skip-repl
139+
<PropertyGroup>
140+
<TargetFramework>net8.0</TargetFramework>
141+
<Nullable>enable</Nullable>
142+
<ImplicitUsings>enable</ImplicitUsings>
143+
<WarningsAsErrors>TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105</WarningsAsErrors>
144+
</PropertyGroup>
145+
````
146+
147+
* [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):
148+
````SH.skip-repl
149+
dotnet build -warnaserror:"TKL001;TKL002;TKL003;TKL004;TKL101;TKL102;TKL103;TKL104;TKL105"
150+
````
151+
132152
## Next Steps
133153
134154
* [Restore Telerik NuGet Packages in CI/CD Workflows](slug:deployment-nuget)

installation/license-key.md

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Scenarios that do not match the above three descriptions result in the following
9393
* A watermark appears on Telerik UI for Blazor components.
9494
* [A warning message appears in the application's build log](slug:troubleshooting-license-key-errors).
9595

96+
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.
97+
9698
### I updated Telerik UI for Blazor in my app and got license errors. Why?
9799

98100
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:

0 commit comments

Comments
 (0)