I got this error because I declared a variable (above the ConfigureServices method) of type that was my context. I had:
CupcakeContext _ctx
Not sure what I was thinking. I know it's legal to do this if your passing in a parameter to the Configure method.