-
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
-
Reference the .NET Smart Components from your app
- If you haven't already, clone this repo locally.
- Add the
SmartComponents.AspNetCore
project from this repo to your solution and reference it from your app.
-
Configure the .NET Smart Components in your app
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 .NET Smart Components to your pages
You can now add the following inside your views/pages: