Error running new v16 project from VS2022

So I installed the project templates for VS2022 and created my first project. I have left the setting blank just to get the project compiled and running. When I run it I get the following error in Program.cs -

System.IO.DirectoryNotFoundException 'UmbracoProject1\wwwroot\media'

at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
at Umbraco.Cms.Core.IO.PhysicalFileSystem.Create()
at Umbraco.Extensions.FileSystemExtensions.TryCreateFileProvider(IFileSystem fileSystem, IFileProvider& fileProvider)
at Umbraco.Cms.Core.IO.ShadowWrapper.Create()
at Umbraco.Extensions.FileSystemExtensions.TryCreateFileProvider(IFileSystem fileSystem, IFileProvider& fileProvider)
at Umbraco.Extensions.ApplicationBuilderExtensions.UseUmbracoMediaFileProvider(IApplicationBuilder app)
at Umbraco.Cms.Web.Common.ApplicationBuilder.UmbracoApplicationBuilder.RegisterDefaultRequiredMiddleware()
at Umbraco.Cms.Web.Common.ApplicationBuilder.UmbracoApplicationBuilder.WithMiddleware(Action`1 configureUmbracoMiddleware)
at Program.<$>d__0.MoveNext() in
\UmbracoProject1\Program.cs:line 15

So I created the media folder in wwwroot, then I get the following error -

Umbraco.Cms.Core.Exceptions.BootFailedException: Boot failed: Umbraco cannot run. See Umbraco’s log file for more details.
at Umbraco.Cms.Core.Exceptions.BootFailedException.Rethrow(BootFailedException bootFailedException)
at Umbraco.Cms.Web.Common.Middleware.BootFailedMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at Umbraco.Cms.Api.Management.Middleware.BackOfficeAuthorizationInitializationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Any help would be greatly appreciated!

You just have to create the folder manually in the wwwroot folder for now. I get this too. IIR it may look for a fonts folder too (Not sure about that) .

-Roger

I tried again, no luck.
I created the wwwroot/media folder, added a placeholder file. I also created the wwwroot/fonts folder with a placeholder file.
But it still errors out in the browser with the following error -

Umbraco.Cms.Core.Exceptions.BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.
   at Umbraco.Cms.Core.Exceptions.BootFailedException.Rethrow(BootFailedException bootFailedException)
   at Umbraco.Cms.Web.Common.Middleware.BootFailedMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Umbraco.Cms.Api.Management.Middleware.BackOfficeAuthorizationInitializationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

SixLabors.ImageSharp is in the stacktrace. Missing images? Not sure how to get this running right now

So the problem I was having was a simple one, but overlooked.
I did not create the database! Once I updated the connection string to SQL Server, created the test database and user, everything loaded up fine.

Gotta love those types of things - been there done that haha.
Glad it’s sorted now :grinning_face_with_smiling_eyes:

Yeah the ImageSharp ‘error’ in the stack trace is a very much a red herring.

If you are just trying to run Umbraco locally with SQL localDb or SqlLite, if you set the properties for unattended installation, the database will be created for you (unattended install to true, setup an unattended username, email and password and a database connectionstring).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.