Wednesday, August 30, 2017

Go To Controller shows “Unable to find a matching controller.” error

Leave a Comment

In VS 2015, for my Web.API project, I installed MVC 5 from nuget via npm. This installation added references and generated web.config file under Views folder.

I added new Controller with generated CRUD functions. When I right click and go to View on action it goes with no problem. But reverse action does not work. If I navigate to view via browser it works as well. Web app compiles as well.

Is there any way for me to fix this navigation problem in VS? Did I forget to add something?

Following Works

this works with no problem

Following gives Error:

this does not work

error

P.S: If I create brand new sample MVC 5 app both actions work as expected, this only happens Web.API project where MVC 5 added later on via nuget.

4 Answers

Answers 1

This happened to me once. Delete the view and try adding the view again by right clicking on the controller action method and clicking Add View again. I think it would solve the problem

Answers 2

There appears to be a default shortcut key Ctrl-M then Ctrl-G.

This will automatically switch between the controller and view page. If you're on the controller/action it will switch to the view and vice versa.

Answers 3

It happens while the controller or view may be not exactly in the controller folder or view folder respectively. It may contain an additional folder. You can solve this issue through adding a new view and delete the old view.

Answers 4

YOU can try it like this, Add Controller first ,then and the View By hands,then you can get the right page what you want ?

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment