31
votes

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 generator: 'The Parameter searchFolders does not contain any entries. Provide at least one folder to search files.'

None of the scaffolders work basically, all giving the same error... Tried rebuidling / clean etc and still get error.

Update Oct 28: Looks like it is a problem with having T4Scaffolding installed. Looks like they are working on a fix.

9
I haven't tried this myself but this could be a known issue with scafolding templates stackoverflow.com/questions/18727299/…Spock
Having the exact same problem! Started Visual Studio using the /log command, but nothing is being logged to ActivityLog.xml when creating a new MVC Controller. Same goes for the error. Any help would be greatly appreciated.Rob Maas
I just googled and found my own solution but it doesn't work. Did you have any luck figuring this out?stink
I solved this problem by uninstalling MvcScaffolding, T4Scaffolding, and T4Scaffolding.CoreRafael A. M. S.

9 Answers

27
votes

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)

7
votes

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

6
votes

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!

2
votes

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.

2
votes

This situation is arriving when you already have T4Scaffolding used in one of your projects in the solution and you added the web project later. Uninstalling T4Scaffolding and T4Scaffolding.Core from package manager console resolved the issue. Somehow I lost the reference to EntityFramework also while uninstgalling the scaffolding, so I had to add the EntityFramework reference again.

2
votes

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

1
votes

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

1
votes

Updgrade EntityFramework.

Install-Package EntityFramework -Version 6.1.2 
0
votes

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...