Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gary Williams 9 posts 29 karma points
    Jul 06, 2023 @ 23:52
    Gary Williams
    0

    Umbraco Upgrade from 9 to 10

    I'm sure this is something that I missed.

    I have a site that is currently running 8.x. I brought a copy of the site along with the database to my laptop, and upgraded it to 9, and everything was good.

    Then I took that and upgraded it to 10, and after making some changes for namespaces and some APIs, the site is showing pages.

    Just one issue - it is not delivering anything from the file system. So all of the media, CSS and scripts are not getting served. The views seem to be working fine. Unfortunately, the log files don't seem to be telling me why.

    My startup.cs looks like this:

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
    
        app.UseSystemWebAdapters();
            app.UseStaticFiles()
        app.UseUmbraco()
            .WithMiddleware(u =>
            {
                u.UseBackOffice();
                u.UseWebsite();
            })
            .WithEndpoints(u =>
            {
                u.UseInstallerEndpoints();
                u.UseBackOfficeEndpoints();
                u.UseWebsiteEndpoints();
            });
    }
    

    I also deployed this to a new application on my Windows Server 2016 and have the same results.

    I know, oh, I'm a dummy! I forgot xxxxx! Well, that's where I hope a quick answer will lead me in the right direction! Thanks!

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Jul 07, 2023 @ 10:00
    Marc Goodson
    0

    Hi Gary

    I'm not sure you need to call app.UseStaticFiles() ??

    As Umbraco is doing this itself?

    https://github.com/umbraco/Umbraco-CMS/blob/0c595ccc5f88750a8f547e4bbbe58c457864094d/src/Umbraco.Web.Common/ApplicationBuilder/UmbracoApplicationBuilder.cs#L76

    If you need to call it for some functionality outside of Umbraco you might be able to do so y using app.UseWhen and excluding the Umbraco folders, example here...

    https://our.umbraco.com/forum/umbraco-9/107501-add-cache-control-header-for-static-files-starjs-starcss-starwoff2-etc#comment-340207

    (and are the files deployed within the wwwroot folder? you don't have them sitting above?)

    regards

    Marc

  • Gary Williams 9 posts 29 karma points
    Jul 07, 2023 @ 14:05
    Gary Williams
    0

    Hi Marc, thanks for the reply!

    I didn't really think UseStaticFiles was required, I would think that would be done normally, I just threw it in there to see if it would solve my problem.

    I told you it was something dumb. I assumed that wwwroot meant the IIS root of the site, not the actual folder called wwwroot. When I moved the files into that folder, the site started working!

    Thanks Marc!

Please Sign in or register to post replies

Write your reply to:

Draft