Tuesday, September 3, 2019

c# - The name 'Model' does not exist in the current context ASP.NET MVC5



I am coding a PlugIn to NopCommerce 3.2, and in the views I get the error mentioned above, but also for 'Layout' and 'Html'. I have copied the same Web.Config that works in another plugin. I have also added the same references as used in the working Plugin. When compiling the plugin works, but I don't have any intellisense and can't trust that VisualStudio marks errors correctly. I am using VS2013 Professional Update 1.



Here is the Web.Config file:





























validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">






























EDIT: Sorry if you find this question not researched, but I assure you I have spent hours to try to find the solution (including those questions I have found here in stackoverflow that are similar and pointing out web.config as the problem which is the reason I have included that file in my question) but can't find it.


Answer



This error was probably caused by Resharper. We are a team of three developers using GIT. One of us installed Resharper, and this probably caused the error for the other two of us. When we installed Resharper trial it suddenly worked again. Unfortunately it isn't working when uninstalling Resharper again...


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...