
原文:
https://docs.devexpress.com/Blazor/401986/getting-started/install-components-and-create-an-application/without-devexpress-installer/microsoft-templates#2-obtain-your-devexpress-nuget-feed
This topic describes how to:
These instructions are also available in the following videos:
The steps below describe how to create a new Blazor project. If you want to add DevExpress Blazor components to an existing application, go to Step 2.



You need to obtain your personal NuGet feed URL to access the DevExpress.Blazor NuGet package from your project.


nuget.org package source is also enabled.

https://nuget.devexpress.com/{your feed authorization key}/api)DevExpress.Blazor NuGet package.

Add the following line to the Pages/_Host.cshtml file's HEAD section:
<head>
<!--...-->
<link href="_content/DevExpress.Blazor/dx-blazor.css" rel="stylesheet" />
</head>
Register the DevExpress.Blazor namespace in the _Imports.razor file:
@using DevExpress.Blazor
Add the following line to the wwwroot/index.html file's HEAD section:
<head>
<!--...-->
<link href="_content/DevExpress.Blazor/dx-blazor.css" rel="stylesheet" />
</head>
Call the AddDevExpressBlazor(IServiceCollection, Action<GlobalOptions>) method from your project's Program.Main() method:
using Microsoft.Extensions.DependencyInjection;
public class Program {
public static async Task Main(string[] args) {
var builder = WebAssemblyHostBuilder.CreateDefault(args);
// ...
builder.Services.AddDevExpressBlazor();
await builder.Build().RunAsync();
}
}
Register the DevExpress.Blazor namespace in the _Imports.razor file:
@using DevExpress.Blazor
Configure the linker as described in Configure the Linker for ASP.NET Core Blazor .
If you enabled the ASP.NET Core hosted option when you create the project, make sure that the server-side project is set as the solution's startup project.
For instructions on how to add an individual DevExpress Blazor component to your application, refer to the documents below:
本文分享自 传输过程数值模拟学习笔记 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!