-
Create a new ASP.NET Core Web App project or use an existing one (.NET 6 or later).
- Command line: Run
dotnet new mvc
ordotnet new razor
- Visual Studio: Select File->New->Project... then choose ASP.NET Core Web App (Model-View-Controller or Razor pages)
- Command line: Run
-
Install packages
-
Install the NuGet package
SmartComponents.AspNetCore
.- Command line:
dotnet add package --prerelease SmartComponents.AspNetCore
- Visual Studio: Right-click your project name, choose Manage NuGet packages..., and then search for and install
SmartComponents.AspNetCore
. Check the Include prerelease option if needed.- Note: Check the Include prerelease option if needed.
- Command line:
-
-
Register SmartComponents in your application
a. In
Program.cs
, under the comment// Add services to the container
, add:builder.Services.AddSmartComponents();
b. In your
_ViewImports.cshtml
file (in thePages
orViews
folder), reference the tag helpers:@addTagHelper *, SmartComponents.AspNetCore
-
Configure the OpenAI backend (if needed)
If you will be using either
smart-paste-button
orsmart-textarea
, you need to provide access to a language model backend. See: Configure the OpenAI backend.If you will only use
smart-combobox
, you don't need any language model backend and can skip this step. -
Add smart components to your pages
You can now add the following inside your views/pages: