Set Up the DevExpress NuGet Package in the Application
- 4 minutes to read
This topic contains detailed instructions on how to add the DevExpress Blazor NuGet Package to an application. You need to obtain NuGet feed credentials, configure a package source, and manage NuGet packages in either Visual Studio (Windows) or the .NET CLI (all operating systems).
Obtain NuGet Feed Credentials
You need to obtain your personal NuGet feed credentials to access the DevExpress.Blazor NuGet package from your project. You can use the NuGet feed URL or feed authorization key to manage DevExpress packages.
Make sure your DevExpress.com account has access to Blazor UI Components. This product line is included in the Universal, DXperience, and ASP.NET subscriptions. Refer to the subscription comparison matrix for more information.
Use your DevExpress credentials to log into nuget.devexpress.com.
Obtain your NuGet feed credentials and copy them to the clipboard.
You can find the same URL in the Download Manager.
Manage NuGet Packages in Visual Studio
Do the following to register a new package source:
In Visual Studio, select Tools → NuGet Package Manager → Package Manager Settings.
Navigate to NuGet Package Manager → Package Sources. Click the plus button at the top right corner to add a new NuGet package source. Use the following package settings:
- Name:
DevExpress
- Source: DevExpress NuGet Gallery (
https://nuget.devexpress.com/api/v3/index.json
) if you use the feed key to authenticate. Otherwise, use the NuGet Feed URL (https://nuget.devexpress.com/{your-feed-authorization-key}/api/v3/index.json
).
Click OK.
Make sure the
nuget.org
package source is also enabled.If you registered the DevExpress NuGet feed with an authorization key, the login form is displayed when you invoke the NuGet Package Manager window for the first time. Enter your credentials as follows:
- User name:
DevExpress
Password: your authorization key
- Name:
Once completed, you need to install a NuGet package if you did not use the DevExpress Template to create the project:
Select Tools → NuGet Package Manager → Manage NuGet Packages for Solution.
Once the dialog appears on screen, open the Browse tab, select the DevExpress 24.2 Local package source, and install the
DevExpress.Blazor
NuGet package.The DevExpress 24.2 Local package is automatically added as a package source to your NuGet configuration files if you used the DevExpress .NET Product Installer.
Build the project.
Refer to the following help topic for more information: Install NuGet Packages in Visual Studio, VS Code, and Rider.
Manage NuGet Packages in .NET CLI
Use the following console commands to register NuGet packages:
# Register packages with an authorization key
dotnet nuget add source https://nuget.devexpress.com/api/v3/index.json -n DXFeed -u DevExpress -p {your-feed-authorization-key}
# Register packages with a feed URL
dotnet nuget add source https://nuget.devexpress.com/{your-feed-authorization-key}/api/v3/index.json -n DXFeed
An error can occur if the specified source is already in the source list. You can run dotnet nuget list source
to view all configured sources and ensure that the specified source and nuget.org
package sources are enabled. To enable them, use the dotnet nuget enable source
command.
Run the following commands to add the DevExpress.Blazor NuGet package to the newly created application if you did not use the DevExpress Template to create the project:
dotnet add package DevExpress.Blazor
dotnet restore
Refer to the following topic for more information: Install NuGet Packages with Command Line Interface (CLI) Tools.
Alternatively, you can add the feed as a package source to your NuGet configuration files. To do this, create the nuget.config
file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyGet" value="https://api.nuget.org/v3/index.json" />
<add key="DevExpress Nuget server" value="https://nuget.devexpress.com/{your-feed-authorization-key}/api/v3/index.json" />
</packageSources>
</configuration>
Note
Storing credentials in a NuGet.config file (especially when saving NuGet.config to your source control) is risky because it can lead to credential leakage. If you store credentials in NuGet.config, please consider using a more secure option as described in Consuming packages from authenticated feeds and How to Protect Your Private NuGet Feed and Safely Consume the Feed From External Systems.
Next Step
If you did not use the DevExpress project template to create the project, click the following button:
Otherwise, procceed to the following step: