Copied to clipboard

Flag this post as spam?

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


  • Rob Watkins 370 posts 702 karma points
    Aug 08, 2023 @ 11:25
    Rob Watkins
    1

    umbraco.cms.staticassets issue

    Okay, I'm really stuck on this one.

    I have a project for an Umbraco 12 site, which I am building then deploying to a web server.

    However, every build it generates a MyApp.staticwebassets.runtime.json file containing the current local user:

    "ContentRoots":["C:\\Users\\Rob\\.nuget\\packages\\umbraco.cms.staticassets\\12.0.1\\staticwebassets\\"]

    When I deploy, the app fails to start with a 500.30 error, and the stdout log is:

        Unhandled exception. System.IO.DirectoryNotFoundException: C:\Users\Rob\.nuget\packages\umbraco.cms.staticassets\12.0.1\staticwebassets\
       at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
       at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot)
       at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func`2 fileProviderFactory)
       at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
       at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
       at Microsoft.Extensions.Hosting.HostBuilder.InitializeAppConfiguration()
       at Microsoft.Extensions.Hosting.HostBuilder.Build()
       at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
       at MyApp.Program.Main(String[] args) in X:\Src\MS.NET\MyApp\MyApp\Program.cs:line 11
    

    I installed Umbraco using the command line tools and it all worked fine, but I need to extend it, so built the solution and in VS and now it won't start.

    What am I doing wrong?!

  • Rob Watkins 370 posts 702 karma points
    Aug 08, 2023 @ 11:30
    Rob Watkins
    0

    If I comment out webBuilder.UseStaticWebAssets(); from Program.cs it works but ... that must be there for a reason right?

  • Rob Watkins 370 posts 702 karma points
    Aug 09, 2023 @ 07:35
    Rob Watkins
    0

    Having researched UseStaticWebAssets it seems it's only of use in development and I think I just don't need it for my build and deployment process. Everything works anyway.

  • Silviu 3 posts 73 karma points
    Oct 06, 2023 @ 04:03
    Silviu
    0

    I am having kind of the same problem when trying to create a docker image. However, commenting out webBuilder.UseStaticAssets does not work for me. I do not have this file either: MyApp.staticwebassets.runtime.json. Where should I look these static assets? Thanks

  • bh 444 posts 1544 karma points
    Nov 28, 2023 @ 18:08
    bh
    0

    I had this same error on a v11.2 site.

    For me, I noticed that the Publish process was throwing an error in the output window and then reporting a successful publish. When in fact the publish was not successful. The error was "unable to remove directory \obj\Release\net7.0\PubTmp\Out\". I went in and manually removed that folder and re-published the site and that did the trick. Hope this helps someone else.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies