iazureenaa / Fitness-Frog

0 stars 0 forks source link

The type or namespace “SelectList” could not be found; The name ‘ViewBag’ does not exist in current context #3

Open shakucing opened 3 years ago

shakucing commented 3 years ago

stackoverflow possible solutions: https://stackoverflow.com/questions/15550899/the-name-viewbag-does-not-exist-in-the-current-context/15553331 https://stackoverflow.com/questions/29319189/the-name-viewbag-does-not-exist-in-the-current-context-visual-studio-2015

shakucing commented 3 years ago

resolved by restarting vscommunity

shakucing commented 3 years ago

reopen.

restarting does not resolve the issue any longer, will try fix the root cause related to the web.config first

iazureenaa commented 3 years ago

Possible solutions:

  1. https://stackoverflow.com/questions/57187100/getting-error-the-type-or-namespace-name-selectlist-could-not-be-found-even
  2. https://ardalis.com/viewbag-does-not-exist-in-current-context/
  3. https://stackoverflow.com/questions/52748122/viewbag-does-not-exist-on-current-context

For second one, you need to check your mvc version, mine is 5.2.7 - You can check > FitnessFrog > Manage NuGet Packages

For third one, you can check inside Views > web.config if namespace "System.Web.Mvc added" image

shakucing commented 3 years ago

after attempt with version changes, reimport, etc, still not able to resolve.

as this is not a showstopper to development will put as KIV