Hosting a WCF service in asp.net mvc 1 aplication and enabling metadata exchange
I want to host a wcf service inside an asp.net MVC (1.0) application, I created a .svc file as it has to be done for web applications, but nothing works. When I try to reach the metadata endpoint the request fails because the request is passing through the rouitng system, so if I have an .svc published in http:localhost/myapp/services/service1.svc
a开发者_开发知识库nd I try to reach it's mex endpoint the request fails because no servicesController
if found.
I have to create a route record to correctly host and publish my service?
I have to specify a particular configuration for wcf services inside a mvc project to avoid routing to be applied?
All the answers about the topic I saw tends to sais just ..no, you have not.. or ..hosting is inside IIS.. but wothout providing detailed explaination. Thanks in advance
I might be overlooking something obvious, but the solution which comes to mind would be to ignore all requests to .svc resources by adding an Ignore rule in your route collection:
routes.IgnoreRoute("*.svc");
精彩评论