Visual Studio 2013 Scaffolding Error

前端 未结 9 771
小鲜肉
小鲜肉 2021-01-31 09:23

I\'m using VS 2013 RTM Ultimate, and when I try to add a Controller to my MVC 5 project I get the following error:

\"There was an error running the selected code generat

9条回答
  •  遥遥无期
    2021-01-31 09:47

    In case you do NOT have MVCScaffolding or T4Scaffolding packages installed and you encounter this bug/problem, check my solution here:

    Scaffolding controller doesn't work with visual studio 2013 update 2

    To sum up: the problem can be caused by the connection string. In my case I used localdb, I switched to a connection string to a standard sql server, then tried to generate the controller with MVC views and it worked.

    I tried to switch back the connection string to localdb, it didn't work. So that must have been the problem...

提交回复
热议问题