umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.37k stars 2.64k forks source link

Umbraco 13 Setup - DirectoryNotFoundException #15858

Open hfloyd opened 4 months ago

hfloyd commented 4 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.2.0

Bug summary

Running a new local v13 site (via IIS - or IIS Express) throws a DirectoryNotFoundException because there is initially no "media" folder.

I saw this happen both using the Visual Studio "UmbracoProject" template to create the new site, as well as for a fresh empty cloned v13 Umbraco Cloud site.

image

Adding an empty "media" folder to the wwwroot allows the site to load properly. It seems the Project template should include a media folder to prevent this startup error, or perhaps if a media folder isn't found, it could just be created on first run?

Specifics

No response

Steps to reproduce

Create a new Umbraco 13 site using the VS template, then run the project.

Expected result / actual result

I would expect the site to run, instead an error is thrown.

github-actions[bot] commented 4 months ago

Hi there @hfloyd!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

hfloyd commented 4 months ago

Looking for something else, I just came across this related issue: https://github.com/umbraco/Umbraco-CMS/issues/14877 which seems to describe what happened to me, and according to this comment:

I think me and @vsilvar figured out why some people have this issue.

@geoffbeaumont when you create a new Umbraco project in VS, which "Development database type" did you select?

The media folder seems to be created as part of the Umbraco install process (and not during project creation or build). Since V12.0.1, if you select "SQL Lite" or "SQL Server Express LocalDB" and do not provide an unattended user email and password, the install process doesn't seem to be executed and the application just tries to render the default page (that requires the media folder).

@Zeegaan was able to run it because the default option for "Development database type" is probably none and this option does not configure any connection string in the appsettings.Development.json making the application trigger the install on the first run and creating the media folder.

Since I was using a local sql server db from a prior version I just added the connection string to the appSettings file directly, so the installation didn't run in the same way, I guess.