I managed to get rid of the errors by forcing the app to use Machine Keys rather than DPAPI and storing the “keys” folder in the root of the project:
Program.cs for reference:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureUmbracoDefaults()
.ConfigureServices((hostContext, services) =>
{
var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "keys");
Directory.CreateDirectory(keysFolder); // Ensure folder exists
Console.WriteLine($"[DataProtection] Keys will be stored in: {keysFolder}");
services.AddDataProtection()
.SetApplicationName("MyUmbracoSite")
.PersistKeysToFileSystem(new DirectoryInfo(keysFolder))
.UseCryptographicAlgorithms(new Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorConfiguration
{
EncryptionAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm.AES_256_CBC,
ValidationAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm.HMACSHA256
});
Console.WriteLine("[DataProtection] Data Protection is now configured.");
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStaticWebAssets();
webBuilder.UseStartup<Startup>();
});
}
However, when trying to restart the application, despite saying that it is listening on localhost - the browser says that the connection got unexpectedly closed, the logs say the following:
"@t":"2025-03-31T13:09:00.5478135Z","@mt":"Acquiring MainDom.","SourceContext":"Umbraco.Cms.Core.Runtime.MainDom","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:00.5556720Z","@mt":"Acquired MainDom.","SourceContext":"Umbraco.Cms.Core.Runtime.MainDom","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0808877Z","@mt":"Starting recurring background jobs hosted services","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0850552Z","@mt":"Starting background hosted service for {job}","job":"HealthCheckNotifierJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0883876Z","@mt":"Starting background hosted service for {job}","job":"KeepAliveJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0885857Z","@mt":"Starting background hosted service for {job}","job":"LogScrubberJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0887302Z","@mt":"Starting background hosted service for {job}","job":"ContentVersionCleanupJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0888645Z","@mt":"Starting background hosted service for {job}","job":"ScheduledPublishingJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0889793Z","@mt":"Starting background hosted service for {job}","job":"TempFileCleanupJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0891458Z","@mt":"Starting background hosted service for {job}","job":"InstructionProcessJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0893771Z","@mt":"Starting background hosted service for {job}","job":"TouchServerJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0896070Z","@mt":"Starting background hosted service for {job}","job":"WebhookFiring","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0897739Z","@mt":"Starting background hosted service for {job}","job":"WebhookLoggingCleanup","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0899251Z","@mt":"Starting background hosted service for {job}","job":"ReportSiteJob","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.0899879Z","@mt":"Completed starting recurring background jobs hosted services","SourceContext":"Umbraco.Cms.Infrastructure.BackgroundJobs.RecurringBackgroundJobHostedServiceRunner","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.5763538Z","@mt":"Now listening on: {address}","address":"https://localhost:44341","EventId":{"Id":14,"Name":"ListeningOnAddress"},"SourceContext":"Microsoft.Hosting.Lifetime","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.5765351Z","@mt":"Now listening on: {address}","address":"http://localhost:7045","EventId":{"Id":14,"Name":"ListeningOnAddress"},"SourceContext":"Microsoft.Hosting.Lifetime","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
{"@t":"2025-03-31T13:09:01.5823259Z","@mt":"Umbraco is in {mode} mode, so uSync will not run this time.","mode":"Install","SourceContext":"uSync.BackOffice.Notifications.uSyncApplicationStartingHandler","ProcessId":16100,"ProcessName":"Architecture.Web","ThreadId":1,"ApplicationId":"c29c303433684f26095e3df7b2ef61017442fe04","MachineName":"xxxxxxxxx","Log4NetLevel":"INFO "}
Judging by the logs it looks like it is running fine, do you have any idea why you can’t access it via a browser?