31

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.

James Reategui
  • 1,307
  • 2
  • 16
  • 23
  • 1
    I haven't tried this myself but this could be a known issue with scafolding templates http://stackoverflow.com/questions/18727299/is-mvcscaffolding-compatible-with-vs-2013-rc-by-command-line – Spock Oct 28 '13 at 12:37
  • 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 Oct 28 '13 at 12:46
  • I just googled and found my own solution but it doesn't work. Did you have any luck figuring this out? – stink Nov 25 '13 at 00:59
  • 1
    I solved this problem by uninstalling MvcScaffolding, T4Scaffolding, and T4Scaffolding.Core – Rafael A. M. S. Jan 28 '14 at 16:10

11 Answers11

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)

Romias
  • 13,783
  • 7
  • 56
  • 85
AKhooli
  • 1,285
  • 1
  • 13
  • 11
  • Thanks, was working around this, I had T4ScaffoldingController installed, and was getting this problem for a couple of weeks.. Just done the uninstall, restarted VS and all working normally again now.... – dave heywood Dec 05 '13 at 14:45
  • 1
    Uninstalling it didn't seem to work for me so I deleted packages/T4Scaffolding* from the disk and then it worked. – Jared Thirsk Feb 15 '15 at 17:20
  • I did not have T4Scaffolding or MVCMailer in my project, however I did get scaffolding to work after simply restarting VS2013. Nothing else. No idea why this would work, I hadn't added any new packages or changed any references etc but it did, Very annoying when something totally unrelated appears to be the solution, but hey ho. – RogerB Oct 09 '15 at 13:25
7

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

6

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!

Armand
  • 69
  • 1
  • 1
  • 2
    Even though this is the opposite of the accepted answer, this fixed my problem. – Alex Kilpatrick Mar 14 '14 at 01:05
  • This helped. The issue was triggered by me upgrading the project to MVC5 .NET 4.5 my T4Scaffolding was still targeting .NET 4.0. After an uninstall and reinstall of T4Scaffolding the packages.config reflected a change of targetFramework="net45" for T4Scaffolding. Restarted Visual Studio and the issue went away. – Geovani Martinez Sep 28 '16 at 22:43
2

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.

Soma Boddy
  • 41
  • 1
2

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.

Andy T
  • 1,355
  • 2
  • 19
  • 30
2

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

Diin
  • 565
  • 11
  • 41
1

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

Dmitriy Dokshin
  • 710
  • 5
  • 25
1

Updgrade EntityFramework.

Install-Package EntityFramework -Version 6.1.2 
Musakkhir Sayyed
  • 7,012
  • 13
  • 42
  • 65
  • I had Visual Studio 2013 Update 4 installed and was working with MVC5 with Entity Framework 6.1.1 and I had the exact same error. Updating the Entity Framework to 6.1.2 helped fixed the problem. Be Sure to restart VS 2013 after EF update. – Steve Johnson Mar 02 '15 at 20:10
  • Not necessary to restart it. – Musakkhir Sayyed Mar 04 '15 at 04:49
0

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

Community
  • 1
  • 1
firepol
  • 1,731
  • 22
  • 39
0

My solution was to open VS installer, then go to modify and install .net framework templates

nanquim
  • 1,786
  • 7
  • 32
  • 50
0

Open visual studio installer and click on ASP.NET and web development and select below options and restart the visual studio.

enter image description here

This will surely work.

Brijesh Mavani
  • 1,070
  • 1
  • 15
  • 23