I'm getting an error in Visual Studio 2015 I was using windows 8.1 and visual studio 2013 and all projects with asp.net MVC 5 were working and developing fine without any error.
Since I installed windows 10 and visual studio 2015 my whole ASP.NET MVC 5 project doesn't work well.
I created new default template in visual studio 2015 to check them. I got the same error on those new project also.
I get errors as :
CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
And
The name "Layout" doesn't exist in current context.
**Things I have already Tried: **
- Repaired VS 2015.
- Uninstalled and installed Install-Package Microsoft.AspNet.Mvc from Nuget
- Copy Local = True
- System.web.MVC already referenced.
- The version of web.config all places 5.2.3.0
I followed these steps in order to completely re-install Visual Studio 2015 which solved the problem. Repair didnt work
run the command
Downloaded the web installer setup file and run the following command in the downloaded directory
After Uninstalling i made sure no file software related to VS is installed and restarted PC
Run the command again.
Updates were available inside Visual Studio , installed them - Restarted Visual Studio
Now open any asp.net mvc solution it takes time though in start but after that it works.
I've run into this error and was able to resolve it with an edit to the
runtime/assemblyBinding
section of the web.config, as follows:This may be in the main
web.config
file and/or the one in the Views directoryHope this helps!
I have the same problem with Visual Studio 2015, every time I open my ASP.NET 5.0 project I get that error, But when I re-open the application again, the errors go away.
By the way the problem seems about correct versioning for example if you are using the Beta 7.0 of ASP.NET 5.0, maybe some packages still use previous versions like Beta 5.0,...
I was getting this error in %AppData%\Microsoft\VisualStudio\14.0\ActivityLog.xml:
I ran C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\Common7\IDE\devenv.exe /resetuserdata and it was fixed.
Taken from Exception when opening a cshtml file