Visual Studio 2013 Scaffolding Error

前端 未结 9 769
小鲜肉
小鲜肉 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:27

    If you have recently installed a package with T4Scaffolding dependency (ex. MVCMailer uses T4Scaffolding.Core), then you can uninstall T4Scaffolding.Core and restart VS 2013. Notice that MvcMailer which caused this in my case, won't work in 2013. Best is to check your references or packages for suspects.

    From comments: Uninstalling it didn't seem to work for me, so I deleted packages/T4Scaffolding from the disk* and then it worked. (by Jared Thirsk)

    0 讨论(0)
  • 2021-01-31 09:31

    I'm facing same situation with you. what i did was

    1. open packages.config remove T4Scaffolding.Core and T4Scaffolding

    2. Reinstall those packages Install-Package T4Scaffolding and Install-Package T4Scaffolding.Core

    3. Close VS2013 and reopen and you should able to scaffold again

    Good Luck!

    0 讨论(0)
  • 2021-01-31 09:35

    Usually after I have installed some new nugget packages, I bump into this error in an attempt to add/scaffold a new controller for example. My solution is just restart VS2013

    0 讨论(0)
  • 2021-01-31 09:37

    Install prerelease of MvcMailer for VS2013 (run VS as administrator) https://www.nuget.org/packages/MvcMailer-vs2013/4.5.1-pre

    0 讨论(0)
  • 2021-01-31 09:39

    I used package manager console to uninstall MVCScaffolding, T4Scaffolding, and T4Scaffolding.Core according to their dependencies. Restart VS2013 and it works.

    0 讨论(0)
  • 2021-01-31 09:43

    In my case the fix worked, but I had two projects in the same VS solution, and the one where I was trying to add a scaffolded controller did not have T4Scaffolding installed. It was a part of the second project. When I unloaded the second project and restarted the IDE, the error went away.

    0 讨论(0)
提交回复
热议问题