I have a small project on ASP.NET MVC 4 beta. When I try to add new WebAPI contoller (with the default set of methods) to the project and make GET request to it from the browser, all I can see is:
<?xml version="1.0" encoding="utf-8"?><string>No type was found that matches the controller named 'values'.</string>
But everything is ok, when I create a new ASP.NET MVC 4 project and add the same controller - everything works fine. So, it seems that something wrong with this particular solution.
How to figure out where is the problem? Any ideas what can be wrong with my solution?
The best way I've found to discover these problems is to turn on break on CLR exceptions in the Debug -> Exceptions dialog. Otherwise, you get 404 and 500 errors with strange error messages.
The best way I've found to discover these problems is to turn on break on CLR exceptions in the Debug -> Exceptions dialog. Otherwise, you get 404 and 500 errors with strange error messages.
Another way is the CLR's FirstChanceException. I have created a
package (in past) for ASP.NET application.
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Alexey Zinov...
Member
10 Points
2 Posts
Web API doesn't work / How to find a reason
Mar 27, 2012 08:25 AM|LINK
I have a small project on ASP.NET MVC 4 beta. When I try to add new WebAPI contoller (with the default set of methods) to the project and make GET request to it from the browser, all I can see is:
<?xml version="1.0" encoding="utf-8"?><string>No type was found that matches the controller named 'values'.</string>But everything is ok, when I create a new ASP.NET MVC 4 project and add the same controller - everything works fine. So, it seems that something wrong with this particular solution.
How to figure out where is the problem? Any ideas what can be wrong with my solution?
Thanks,
Alexey
Alexey Zinov...
Member
10 Points
2 Posts
Re: Web API doesn't work / How to find a reason
Mar 27, 2012 08:44 AM|LINK
Sorry, my fault. It was just a silly problem with project configuration.
panesofglass
Participant
758 Points
242 Posts
Re: Web API doesn't work / How to find a reason
Mar 27, 2012 03:49 PM|LINK
The best way I've found to discover these problems is to turn on break on CLR exceptions in the Debug -> Exceptions dialog. Otherwise, you get 404 and 500 errors with strange error messages.
imran_ku07
All-Star
45864 Points
7713 Posts
MVP
Re: Web API doesn't work / How to find a reason
Mar 28, 2012 03:30 AM|LINK
Another way is the CLR's FirstChanceException. I have created a package (in past) for ASP.NET application.
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD