Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore Routes to {resource}/Services/*.svc

I'm trying to ignore every URL that is of the form http://domain/Services/{serviceName}.svc/mex?wsdl so I added the following to the top of my RegisterRoutes method in the Global.asax file:

        routes.IgnoreRoute("{resource}/Services");
        routes.IgnoreRoute("{resource}/Services/{pathInfo}.svc");

This did not solve the problem and it is still trying to get resolved by the default route which obviously fails.

The problem started when I try to browse a WCF service (this works), but then when I try to view its metadata, I get a 404 Error.

Any suggestions?

like image 252
Kassem Avatar asked Jan 30 '26 20:01

Kassem


1 Answers

routes.IgnoreRoute("{Services}/{*pathInfo}");

like image 132
Michael Avatar answered Feb 02 '26 14:02

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!