question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boxed.AspNetCore.TagHelpers.SubresourceIntegrityTagHelper v4.0 with .net core 3.1

See original GitHub issue

Firstly thank you for a great project.

Describe the bug

I’ve been using your Boxed.AspNetCore.TagHelpers.SubresourceIntegrityTagHelper for a while, but I ran into an issue when I recently updated to .net core 3.1 using your v4.0.0 of the library.

It actually threw an unhandled exception. It seems the wrong path is used Version 3.2.0 is OK, version 4.0.0 causes issues for me

…Deployments\Foo\Staging\Foo.Web\js\vendor\jquery.min.js’. doesn’t seem to have the wwroot like as follows: Deployments\Foo\Staging\Foo.Web\wwroot\js\vendor\jquery.min.js’.

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Programming\Deployments\Foo\Staging\Foo.Web\js\vendor\jquery.min.js'.

   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)

   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)

   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)

   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)

   at System.IO.File.ReadAllBytes(String path)

   at Boxed.AspNetCore.TagHelpers.SubresourceIntegrityTagHelper.ReadAllBytes(String filePath)

   at Boxed.AspNetCore.TagHelpers.SubresourceIntegrityTagHelper.GetSubresourceIntegrityFromContentFile(String contentPath, SubresourceIntegrityHashAlgorithm hashAlgorithms)

   at Boxed.AspNetCore.TagHelpers.SubresourceIntegrityTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)

   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)

   at AspNetCore.Views_Shared__Layout.<>c__DisplayClass78_0.<<ExecuteAsync>b__31>d.MoveNext() in C:\Programming\GitLab-Runner\builds\aacd9b09\0\thedomainpublisher\Foo\src\foo.Web\Views\Shared\_Layout.cshtml:line 410

--- End of stack trace from previous location where exception was thrown ---

   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()

   at AspNetCore.Views_Shared__Layout.<>c__DisplayClass78_0.<<ExecuteAsync>b__1>d.MoveNext() in C:\Programming\GitLab-Runner\builds\aacd9b09\0\thedomainpublisher\foo\src\foo.Web\Views\Shared\_Layout.cshtml:line 396

--- End of stack trace from previous location where exception was thrown ---

   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()

A clear and concise description of what the bug is.

To Reproduce

Unfortunately can’t give you a test project just yet

Expected behaviour

Shouldn’t throw an exception

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Boxed.AspNetCore.TagHelpers 6.0.0
Provides ASP.NET Core middleware, MVC filters, extension methods and helper code for an ASP.NET Core project. Fluent Interface Extensions. ASP.
Read more >
Tag Helpers in ASP.NET Core
Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files. For example, the built-in ...
Read more >
Why TagHelpers in Asp.net Core 3.1 is not working?
No , The Problem Is Fixed , i created a project of type (Web Application) In My Solution And Tested the taghelper there...
Read more >
ASP .NET CORE MVC TAG HELPERS
NET MVC Core Tag Helpers make you more productive and able to produce more robust, reliable, and maintainable code using information only available...
Read more >
Tag helpers in asp net core - YouTube
Tag helpers are new in ASP.NET Core. Let's understand what are Tag Helpers and their use with an example. Text version of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found