Base solution for your next web application
Open Closed

Some Resources seem to be missing #11405


User avatar
0
alexanderpilhar created

11.4.0, Angular

Problem In production-environment logs I see a lot of entries of this message:

ERROR 2022-12-16 19:47:04,138 [112 ] e.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred while executing the request.
System.IO.FileNotFoundException: Could not find file: /Common/Images/app-logo-on-light.png.
File name: '/Common/Images/app-logo-on-light.png'
at Microsoft.AspNetCore.Mvc.Infrastructure.VirtualFileResultExecutor.ExecuteAsync(ActionContext context, VirtualFileResult result)
at Microsoft.AspNetCore.Mvc.VirtualFileResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResultFilterAsync[TFilter,TFilterAsync]()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Further information I have forked the full project I can see there are different resources located in:

  • aspnet-zero-core\aspnet-core\src\MyCompanyName.AbpZeroTemplate.Web.Mvc\wwwroot\Common\Images
  • aspnet-zero-core\aspnet-core\src\MyCompanyName.AbpZeroTemplate.Web.Public\wwwroot\Common\Images

One of those resources missing in Web.Public is app-logo-on-light.png (there is only app-logo-on-light.svg, so SVG instead of PNG).

Please, have a look at this issue!


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @alexanderpilhar

    Do you get this error when running Public website ?

  • User Avatar
    0
    alexanderpilhar created

    Hi @ismcagdas

    No, I don't use the public website and it is not running anywhere. Still, the log message appears very often.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Do you have wwwroot/Common/Images/app-logo-on-light.png under your production deployment ?

  • User Avatar
    0
    alexanderpilhar created

    Ah, right, I would need to have this file located at aspnet-zero-core\aspnet-core\src\MyCompanyName.AbpZeroTemplate.Web.Host\wwwroot\Common\Images!

    But it is not there, not even in the github project. But there are the .svg files - so, it seems there is the wrong file linked somewhere?

  • User Avatar
    0
    alexanderpilhar created

    I made the Angular application into a PWA and I think maybe some of our clients just never update the client application and therefor are still using a version in which the .png file was linked...

    I close this now as it seems irrelevant and not an issue of ASPNETZERO.

    Anyway, thank you @ismcagdas!