Scaffolding controller doesn't work with visual studio 2013 update 3 and 4

前端 未结 11 1514
慢半拍i
慢半拍i 2020-12-23 19:53

Im unable to scaffold a controller (MVC5 Controller with views, using Entity Framework) in Visual studio 2013 (update 3 and 4). The error message is below:

There was

11条回答
  •  佛祖请我去吃肉
    2020-12-23 20:15

    Simple workaround that worked for me (after trying many other solutions suggested here and other places in vain...).

    In the scaffolding dialog I just added a new DataContext e.g. TempContext. All the scaffolding worked as expected and then I could simply move the generated code in TempContext into my original DbContext and renamed the TempContext in the generated controllers to the original DbContext.

提交回复
热议问题