I had started to get this annoying error when I ran my web app:
Exception has been thrown by the target of an invocation.
Simple fix. Add back those virtual keywords onto my POCOs that somehow disappeared.
public int Id {get;set} –> public virtual int Id {get;set;}