Repository navigation
bootstrap your application
vijay@envivo edited this page May 21, 2026
·
11 revisions
Within your Model Explorer project, change program.cs to the following:
using DomainModel;
using Envivo.Fresnel.Bootstrap.WinForms;
using Envivo.Fresnel.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading;
using System.Windows.Forms;
// WinForms needs STA:
Thread.CurrentThread.SetApartmentState(ApartmentState.Unknown);
Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
ApplicationConfiguration.Initialize();
var builder = new HostApplicationBuilder(args);
builder.AddFresnel(opt =>
{
opt
.WithModelAssemblyFrom<MyAggregateRoot>()
.WithDefaultFileLogging()
;
});
var host = builder.Build();
var mainForm = host.Services.GetService<BlazorWinForm>();
Application.Run(mainForm);using DomainModel;
using Envivo.Fresnel.Bootstrap.WebServer;
using Envivo.Fresnel.Features;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.AddFresnel(opt =>
{
opt
.WithModelAssemblyFrom<MyAggregateRoot>()
.WithDefaultFileLogging()
;
builder.Services.AddLogging();
});
var app = builder.Build();
app.UseFresnel();
app.UseHttpsRedirection();
app.UseAntiforgery();
await app.RunAsync();using DomainModel;
using Envivo.Fresnel.Bootstrap.WebAssembly;
using Envivo.Fresnel.Features;
using WebAssemblyHostBuilder = Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.AddFresnel(opt =>
{
opt
.WithModelAssemblyFrom<MyAggregateRoot>()
;
});
var host = builder.Build();
host.UseFresnel();
await host.RunAsync();Run this application, and you should see an empty workbench.
Copyright © 2022-2026 Envivo Software
-
Objects
-
Configuring your Model
-
Testing your model
-
Other features