VahidN / DNTCaptcha.Blazor

A captcha generator for the Blazor based applications.
Apache License 2.0
33 stars 9 forks source link

staticwebassets missing #2

Closed xaverine closed 2 years ago

xaverine commented 2 years ago

Summary of the issue

nuget package doesn't output staticwebassets folder & its content => dntCaptcha.js

Manual fix

- grab dntCaptcha.js from the demo website
- manually create staticwebassets folder & its content in user's .nuget dntcaptcha

Environment

Windows 10 + Blazor WebAssembly + Asp.Net hosted

DNTCaptcha.Blazor version: 1.1.0
.NET Core SDK version: 5.0

Example code/Steps to reproduce:

Just trying to get the runtime working

Output:

From Asp.Net hosted server...

Exception message:

System.IO.DirectoryNotFoundException
  HResult=0x80070003
  Message=C:\[UserFolder]\.nuget\packages\dntcaptcha.blazor\1.1.0\staticwebassets\
  Source=Microsoft.Extensions.FileProviders.Physical

Full Stack trace:

 Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
   Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root)
   Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsFileProvider..ctor(String pathPrefix, String contentRoot)
   Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__2_0(ContentRootMapping cr)
   System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   System.Linq.Enumerable.<OfTypeIterator>d__62`1.MoveNext()
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   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()
   Server.Program.Main(String[] args)
VahidN commented 2 years ago

RC1 couldn't create the NuGet package and now RC2 doesn't add static files. It seems we have to wait for the RTM release.

xaverine commented 2 years ago

no prob, manual fix is good for the moment. great work!