Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Error 500 after adding taghelper

I am studying MVC 6. It was going ok, however after adding the taghelper in my _ViewImports.cshtml my app stopped.

These are my dependencies:

"dependencies": {
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final"
  },

I added this line:

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

And now I am getting the error:

Cannot resolve TagHelper containing assembly 'Microsoft.AspNet.Mvc.TagHelpers'. Error: Could not load type 'Microsoft.Extensions.Logging.ILogValues' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

Any suggestions ? I could not find anything related to the same message.

like image 571
Bruno Quintella Avatar asked Dec 24 '22 05:12

Bruno Quintella


1 Answers

I was having the same issue. It looks like the assembly part has changed in RC2. I fixed it by changing from:

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

to:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
like image 137
user2999658 Avatar answered Jan 06 '23 07:01

user2999658