Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when trying to create a new empty controller: 'Sequence contains no matching element'

SOLVED?: I had originally changed the directory of the new project from the default (which is inside users -> yourusername -> source -> repos) to my desktop. Moving the folder back into the repos solved the issue + I ran Visual Studio 2017 as an admin also. I'm not gonna pretend to know why these solved the issue, so if anybody could enlighten me, I would really appreciate it.


I'm following a UDemy course: ASP.NET CORE MVC 2.0, and i'm using Visual Studio Community 15.8.1

When I right click the controllers folder and click add new controller, then click add new empty controller: The error I keep getting is: There was an error running the selected code generator: 'Sequence contains no matching element'

I was able to find 2 similar questions and solutions on the web. In both cases, there was some security software blocking some part of them building a new controller. But I'm not sure how to go about finding if my firewall is blocking some part of this process. Or maybe there is something else causing this.... Does anyone know the solution to this?

like image 408
Pirouetter711 Avatar asked Jan 24 '26 20:01

Pirouetter711


1 Answers

I had the same issue recently and found the problem was solved by running Visual Studio 2017 as Administrator.

Hope this helps if anyone else finds the problem.

like image 127
David Robinson Avatar answered Jan 27 '26 02:01

David Robinson