I had Visual Studio 2017, Visual Studio 2019 and old project in .NET 4 (ASP.NET website). Everything works perfectly on Windows 10 64 bit the last build, then I uninstall VS 2017 today.
After I uninstalled Visual Studio 2017, I now get this error:
Error CS0103 The name 'ViewBag' does not exist in the current context Error CS0103 The name 'model' does not exist in the current context
But when I check Visual Studio Installer I have already .NET Framework 4 and ASP.NET MVC 4 installed.
I have this in my web.config
file:
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Am I missing an ASP.NET MVC 3 framework? But when I try to install I got this error:
Is there any solution?
Update:
I try this solution: The name 'ViewBag' does not exist in the current context - Visual Studio 2015, but does not work for me
But when I check it in Visual Studio 2019 Installer, I had already installed
I also try to install Visual Studio 2017 back and VS 2015, but I had still the same error and is it not possible to install ASP MVC 3 But when I run webapp in Visual Studio, webpage works fine