Asp.Net Core 3.1 MVC 5 Error ViewBag does not Exist in the Current Context

Asp.Net Core 3.1 MVC 5 Error ViewBag does not Exist in the Current Context

Click to Watch Video

Question: How do you resolve  an Asp.Net Core 3.1 MVC 5 Error "ViewBag does not Exist in the Current Context"

Answer: Make sure that you are only using Microsoft.AspNetCore.MVC and not System.Web.Mvc. This error shows up if you are upgrading an Asp.Net Application from .Net 4.7 to .Net Core.

 

Asp.Net Core 3.1 Error ViewBag does not exist in the current context


Edit this Article
MVC5 ViewBag does not exist in current context Technology published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy