c# - Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' -
i'm using visual studio 2015 community edition, , i've created asp.net mvc 5 project.
when open view (index
of home
or other), shows first 3 lines of page underlined red syntax issue. here error:
encountered unexpected error when attempting resolve tag helper directive '@addtaghelper' value 'microsoft.aspnet.mvc.razor.taghelpers.urlresolutiontaghelper, microsoft.aspnet.mvc.razor'. error: object reference not set instance of object
the screenshot:
when build project, build successfully. when run it, shows lot of errors, runs application.
the type or namespace name 'mvc' not exist in namespace 'microsoft.aspnet' (are missing assembly reference?)
and
'_page_views_home_index_cshtml.executeasync()': no suitable method found override
how can rid of this?
here's how fixed issue:
first, reset visual studio component cache closing visual studio , deleting folder:
c:\users\[username]\appdata\local\microsoft\visualstudio\14.0\componentmodelcache
and finally, check web.config
files , change:
<appsettings> <add key="webpages:version" value="2.0.0.0" /> ... </appsettings>
to
<appsettings> <add key="webpages:version" value="3.0.0.0" /> ... </appsettings>
Comments
Post a Comment