limbo-works / Limbo.Umbraco.ModelsBuilder

Custom models builder for Umbraco.
MIT License
4 stars 3 forks source link

Version 2.0.0-alpha002 - NuGet "DirectoryNotFoundException" for "staticwebassets" #15

Closed hfloyd closed 2 years ago

hfloyd commented 2 years ago

Just did the NuGet update to the latest version (2.0.0-alpha002).

Build worked fine, but on running the site in a browser I get this:

image

An error occurred while starting the application.
DirectoryNotFoundException: C:\Users\Heather\.nuget\packages\limbo.umbraco.modelsbuilder\2.0.0-alpha002\staticwebassets\
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root, ExclusionFilters filters)

DirectoryNotFoundException: C:\Users\Heather\.nuget\packages\limbo.umbraco.modelsbuilder\2.0.0-alpha002\staticwebassets\
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root, ExclusionFilters filters)
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root)
Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader+<>c.<UseStaticWebAssetsCore>b__1_0(string contentRoot)
Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func<string, IFileProvider> fileProviderFactory)
Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
Microsoft.AspNetCore.WebHost+<>c.<ConfigureWebDefaults>b__9_0(WebHostBuilderContext ctx, IConfigurationBuilder cb)
Microsoft.AspNetCore.Hosting.GenericWebHostBuilder+<>c__DisplayClass9_0.<ConfigureAppConfiguration>b__0(HostBuilderContext context, IConfigurationBuilder builder)
Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
Microsoft.Extensions.Hosting.HostBuilder.Build()
Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
UmbracoProject.Program.Main(string[] args) in Program.cs
+
            => CreateHostBuilder(args)

Any ideas?

abjerner commented 2 years ago

That is weird. I don't really have any good ideas for why the directory isn't there.

What is located inside your C:\Users\Heather\.nuget\packages\limbo.umbraco.modelsbuilder\2.0.0-alpha002 directory? here is mine:

image

The staticwebassets directory is also part of the package when exploring here:

https://nuget.info/packages/Limbo.Umbraco.ModelsBuilder/2.0.0-alpha002

How have you installed the package? I guess you already have tried this, but does it works after rebuilding in VS or running dotnet restore and dotnet build?

hfloyd commented 2 years ago

What's weird is that the 'staticwebassets' folder is there: image

And these are the contents: image

(There are files inside those folders, so it seems all is present...)

I updated it via VisualStudio, and rebuilt. dotnet restore just shows All projects are up-to-date for restore.

hfloyd commented 2 years ago

I did some more general web searching on the issue and came across other software packaged with similar issues reported.

One of the suggestions was to make sure that iis_iusrs has full control of the .nuget folder.... so I updated the permissions via Windows Explorer:

image

After rebuilding in VS, the site loaded.

It seems to be a strange sort of requirement... but whatever... 🤷‍♂️

Thanks for your reply!

abjerner commented 2 years ago

I haven't seen that before, so 🤷‍♂️ indeed seems like suitable smiley...

But great to see you found a solution 👍