Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge nuget-updates-1918 into production #1922

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 25 additions & 3 deletions installation/nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Refer to the [Microsoft documentation about using packages in Visual Studio](htt

## Use the .NET CLI

When adding NuGet sources from the .NET CLI, the credentials are stored inside the `NuGet.Config` file. The [password will be encrypted only on Windows](#store-encrypted-credentials). On other platforms, store the password in plain text or use a [NuGet API Key](#use-nuget-api-key) instead of a password.
When adding NuGet sources from the .NET CLI, the credentials are stored in the `NuGet.Config` file. The [password can be encrypted on Windows, but with limitations](#store-encrypted-credentials). You can use a plain text password, but for better security, [generate a NuGet API Key](#use-nuget-api-key), and use it with the .NET CLI instead of a password.

To add the Telerik NuGet package source with the .NET CLI, use the [`dotnet nuget add source`](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source) command. This command creates or updates a `NuGet.Config` file for you, so you don't have to [edit it manually](#edit-the-nugetconfig-file).

Expand Down Expand Up @@ -85,7 +85,7 @@ dotnet nuget update source "TelerikOnlineFeed" \

### Store Encrypted Credentials

NuGet password encryption is not supported by the .NET CLI on non-Windows platforms.
The .NET CLI supports NuGet password encryption only on the Windows platform. Note that [the encrypted password in the `NuGet.Config` file will work only for one user and one machine](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials).

If you [add the Telerik package source in Visual Studio](#use-visual-studio), the credentials will be encrypted and stored in the Windows Credential Manager on Windows and in the Keychain on macOS.

Expand Down Expand Up @@ -135,9 +135,31 @@ You can [generate your Telerik NuGet API Key on telerik.com](https://www.telerik
> Always use the NuGet API Key in plain text.


## Package Source Mapping

The `Telerik.UI.for.Blazor` NuGet package and most of its dependencies reside on `nuget.telerik.com`. On the other hand, the [Telerik icon packages]({%slug common-features-icons%}) reside on `nuget.org`. The correct [package source mapping](https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping) configuration should be similar to:

>caption packageSourceMapping configuration for Telerik UI for Blazor

<div class="skip-repl"></div>

````CSHTML
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
<package pattern="Telerik.FontIcons" />
<package pattern="Telerik.SvgIcons" />
</packageSource>
<packageSource key="TelerikOnlineFeed">
<package pattern="Telerik.*" />
</packageSource>
</packageSourceMapping>
````


## Troubleshooting

For tips about common pitfalls when working with the Telerik NuGet feed, see the [NuGet Troubleshooting]({%slug troubleshooting-nuget%}) article.
See the [NuGet Troubleshooting]({%slug troubleshooting-nuget%}) article for tips about common pitfalls when working with the Telerik NuGet feed.


## Next Steps
Expand Down
9 changes: 9 additions & 0 deletions troubleshooting/nuget-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Regardless of the cause for the issue, it is recommended that you start from the
* [Error `Unable to find package`](#unable-to-find-package)
* [Error `503 Service Unavailable`](#error-503-service-unavailable)
* [Message about package `version not found`](#package-version-not-found)
* [Error `Unable to resolve ... . PackageSourceMapping is enabled`](#unable-to-resolve-package-due-to-packagesourcemapping)

## Tips for Handling Common NuGet Issues

Expand Down Expand Up @@ -98,6 +99,14 @@ This error means that version `3.6.1` is outside the subscription period of your

To solve the issue, use a different version or ask the license holder at your company to assign you another license that includes the desired product version.

## Unable to Resolve Package due to PackageSourceMapping

Incorrect package source mapping can result in errors similar to:

`NU1100 Unable to resolve 'Telerik... (>= ...)' for 'net...'. PackageSourceMapping is enabled, the following source(s) were not considered: ...`

The solution is to check the **Package Source Mapping** settings in Visual Studio, or [review all applicable `NuGet.Config` files](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses) on the machine. Then, [adjust the package source mapping configuration]({%slug installation/nuget%}#package-source-mapping).

## See Also

* [Setting Up the Online Private Telerik NuGet Feed]({%slug installation/nuget%})
Expand Down
Loading