I have read a lot on this and I still don't see the error.
MARS is enabled.
The error is being thrown on an Invoke on a view component which previously was working fine.
public IViewComponentResult Invoke(int id) { var mproductKitset = from p in _context.ProductKitset .Include(p=>p.Product) .Where(p => p.ProductKitsetNameID == id ) select p; ViewBag.ptotal = mproductKitset.Sum(p => p.Product.CostPrice * p.Quantity); return View(mproductKitset); }
Error is highlighting ViewBag.ptotal
I am sorry, I am not understanding why this is being thrown, and why it started suddenly after working fine previously?