1

previously I was using vs2015. After that I installed vs2019. I opened the project in vs2019 below error appears

CS0103 C# The name 'Url' does not exist in the current context

&

CS0103 C# The name 'ViewBag' does not exist in the current context

I tried below methods -

  1. I google this error, follow that steps like clear Cache files for below path. But not happening anything. "%localappdata%\Microsoft\VisualStudio\16.0_28331b6d\ComponentModelCache"

  2. FYI link - The name 'ViewBag' does not exist in the current context

enter image description here

I tried everything but same error appears.

Raj
  • 11
  • 5
  • What kind of project? (View bag implies ASP.NET, but is this core or not?) Have you ensured you have restored all package dependencies? – Richard Apr 11 '19 at 12:53
  • I am using asp.net azure project. Ya also I already check mark "Allow NuGet to download missing packages" option. – Raj Apr 11 '19 at 13:07
  • Azure could be either ASP.NET or ASP.NET Core: which (please add correct tags to the question). – Richard Apr 11 '19 at 13:20
  • Please don't post images of your code, include the actual text – James Z Apr 11 '19 at 13:40
  • 1
    Your VS2019 installation is probably missing the ASP.Net development components. Go back and run the installer and make sure everything is installed that needs to be. –  Apr 11 '19 at 13:47
  • @Amy- Firstly when I run the installer, I just click ASP.NET & web development, something I missed? – Raj Apr 11 '19 at 13:57
  • I don't know, I can't see your screen. I believe this is the most likely cause of your issue, though. –  Apr 11 '19 at 13:58
  • I uninstall & again install vs2019, facing the same issue. If it's possible the ill share my screen. – Raj Apr 11 '19 at 14:30

0 Answers0