Visual Studio displays errors even if projects are successfully created in Razor html

Intellisense does not work for any razor html tags. A red line is also shown in all html razor tags (@Html.TexBox, @Html.DropdownList MultiSelect etc)

The Visual Studio error window displays an error of three types.

Error # 1:

Type arguments for the method 'System.Web.Mvc.Html.InputExtensions.TextBoxFor (System.Web.Mvc.HtmlHelper, System.Linq.Expressions.Expression> System.Collections.Generic.IDictionary)' cannot be taken out of use. Try explicitly specify type arguments.

Error # 2:

One or more of the types required to compile a dynamic expression cannot be found. Are you missing the links for Microsoft.CSharp.dll and System.Core.dll?

Error No. 3:

Error 40 Type arguments for the method "System.Web.Mvc.Html.InputExtensions.HiddenFor (System.Web.Mvc.HtmlHelper, System.Linq.Expressions.Expression>)" cannot be taken out of use. Try specifying type arguments explicitly.

See the attached link for more information.

enter image description here
enter image description here

+5
source share
3 answers

The problem is resolved by deleting all contents from the following folder.

C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET Files C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files

Thank you all for your time. :)

+4
source

This happens to me from time to time, usually rebuilding a project that contains errors works for me. Have you tried this?

Tell me.

0
source

If the closures and rebuilds are not sorted, I suspect there is a problem with your project file.

Create a new ASP.net web application and copy the files. A bit of pain, but it will probably work.

0
source

Source: https://habr.com/ru/post/1232724/


All Articles