C
C#2mo ago
WhiteCharun

✅ [Docker Compose] The path must be absolute. (Parameter 'root')

I added docker orchestration to my MVC project using Docker Compose but when I start the application in debug mode I get System.ArgumentException: 'The path must be absolute. (Parameter 'root')' on the line var builder = WebApplication.CreateBuilder(args);. The strange thing is that I don't get that exception in release mode.
8 Replies
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
WhiteCharun
WhiteCharunOP2mo ago
Wrong post?
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
WhiteCharun
WhiteCharunOP2mo ago
It's just that it's the default program.cs of asp.net
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllersWithViews();

// Add SignalR
builder.Services.AddSignalR();
builder.Services.AddSingleton<IConnectionManager, ConnectionManager>();
builder.Services.AddSingleton<HtmlSanitizer>();

builder.Services.AddSession();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();

app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");


app.MapHub<ChatHub>("chatHub");

app.UseSession();

app.Run();
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllersWithViews();

// Add SignalR
builder.Services.AddSignalR();
builder.Services.AddSingleton<IConnectionManager, ConnectionManager>();
builder.Services.AddSingleton<HtmlSanitizer>();

builder.Services.AddSession();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();

app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");


app.MapHub<ChatHub>("chatHub");

app.UseSession();

app.Run();
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
WhiteCharun
WhiteCharunOP2mo ago
Thanks

Did you find this page helpful?