Posted on 23/01/2023 09:56:37
The easiest way to get started with DW10 as a custom app is to create new empty ASP.NET Core application using .NET 7. Then you need to go to the NuGet Package Manager and find the package Dynamicweb.Suite. You need to check the box to include pre-release packages for it to show up. Add this package to your project. Once that's done, you need to configure the app to use Dynamicweb. Change your Program.cs file and add both AddDynamicweb and UseDynamicweb. It should look something like this if the app is configured for top-level statements:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDynamicweb(builder.Environment, builder.Configuration);
var app = builder.Build();
app.UseDynamicweb();
app.Run();
Next, we need a Files folder. There are two options for getting one. Either start the app and install a new one, or use an existing one. For an existing one, you can either copy it to the wwwroot folder of the app (App->wwwroot->Files), or you can point to it in the appsettings.json by adding an entry called FilesPath ("FilesPath": "C:\\dev\\solutions\\dw10test\\Files").
Basically, the steps are these:
- Create a new empty ASP.NET Core web app using .NET 7
- Install the NuGet package Dynamicweb.Suite (requires pre-release flag)
- Change Program.cs to use Dynamicweb 10
- Add a Files folder
There will be a proper guide on our Dynamicweb 10 doc site, but it's not ready yet. Hopefully, we'll start to roll out some documentation over the next couple of weeks. We will also have an easy starter template so getting started could be as simple as dotnet new dw10.
Let me know if you run into an issues.
- Jeppe