The type arguments cannot be inferred from the usage. Try specifying the type arguments explicitly

I am running an ASP.NET MVC project on my linux machine with the latest version of rider, I have the following error in the cshtml files

The type arguments cannot be inferred from the usage. Try specifying the type arguments explicitly. Candidates are: System.Web.Mvc.MvcHtmlString ValidationMessageFor <clsCompania, TProperty> (this System.Web.Mvc.HtmlHelper <Entities.clsCompania>, System.Linq.Expressions.Expression <System.Func <Entities.clsCompania >>, TProperty >> , string, object) (in class ValidationExtensions) System.Web.Mvc.MvcHtmlString ValidationMessageFor <clsCompania, TProperty> (this System.Web.Mvc.HtmlHelper <Entities.clsCompania>, System.Linq.Expressions.Expression <System.Func < Entities.clsCompania, TProperty >>, string, string) (in class ValidationExtensions) System.Web.Mvc.MvcHtmlString ValidationMessageFor <clsCompania, TProperty> (this System.Web.Mvc.HtmlHelper <Entities.clsCompania>, System.Linq.Expressions .Expression <System.Func <Entities.clsCompania, TProperty >>, string, System.Collections.Generic.IDictionary <string, object>) (in class ValidationExtensions)

this is the code:

<div class = "form-group">
@ Html.LabelFor (model => model.Country, htmlAttributes: new {@class = "control-label col-md-2"})
<div class = "col-md-10">
@ Html.EditorFor (model => model.Country, new {htmlAttributes = new {@class = "form-control"}})
@ Html.ValidationMessageFor (model => model.Pais, "", new {@class = "text-danger"})
</div>
</div>

I want to add that this error does not give me in VS in windows

0
1 comment

it also gives me this error when running the project.

System.TypeLoadException
Could not load type of field 'System.Web.Http.Controllers.HttpControllerSettings: _formatters' (0) due to: Could not load file or assembly' System.Net.Http.Formatting, Version = 5.2.3.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 'or one of its dependencies.

my operating system is debian 10

0

Please sign in to leave a comment.