Thursday, 1 February 2018

asp.net mvc - What do the .config files look like in a fresh MVC 4 PRoject



I'm working on an existing MVC 4 project with Visual Studio 2015 RC1. I'm seeing the following errors in the cshtml files. With @model "The name 'model' does not exist in the current context."




Unfortunately this answer doesn't work for me, as I'm unable to create a fresh MVC 4 project with which to copy.



Can someone please post the fresh ~/Web.config and ~/Views/Web.config files for a fresh MVC 4 project?



For example at the top of the following strongly typed view...



@model ExposureTrack.Website.Models.Assessments

@{

ViewBag.Title = "Assessments";
}


I'm seeing a squiggly under @model with the error mentioned above.


Answer



~/Web.config

















































































































~/Views/Web.config








































validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

















No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...