1

I know that ASP.NET MVC 4 can't route Web API in Areas (sic!).

I created for testing purposes new "Web API" project (in new solution) in Visual Studio 2012.

But it doesn't work. Default HomeController (Controller) works, but ValuesController (ApiController) is not found (404).

I have installed both VS 2010 and VS 2012.

Any ideas?

1
  • are you sure you used the right URL? API controller routing is different from view controller routing by default. In the default project, the values controller is accessed by URL ~/api/Values, not ~/Values (as a view controller would be). Commented Sep 23, 2012 at 11:54

1 Answer 1

3

ASP.NET MVC 4 can't route Web API in Areas out of the box. However, with a little bit of effort you can make it work: Why are my Area specific Web API’s accessible from all other Areas?

Related blog post with more details here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.