Rest – IIS offers .svc file for download instead of executing it on the server!

asp.netconfigurationrestwcf

My RESTful WCF Web service appears to break itself if I leave it alone for a while! I can leave my PC with everything working and when I return and test the service with a simple url request it'll offer me the .svc file for download instead of initiating the request on the server!

This WCF service sits in it's own IIS Application folder under the root. I can get the service going again by opening up the IIS sub-folder in Visual Studio, deleting the web.config file and then adding it in again.

My first thought was that HTTP handler mappings for .svc have been borked so I re-ran ServiceModelReg.exe -i, but that hasn't resolved the issue.

Looking at the Handler Mappings for this IIS Application they appear correct and are inherited from the the web root. It's worth mentioning that this site also has another Application folder running WCF services from a .svc fle and is still functioning fine!

Now that I've checked the obvious am a bit flumoxed about where to look next! Hoping someone has suggestions…

Best Answer

Are you running IIS6 or IIS7? And what .NET-version?

IIS6: http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/

IIS7: Test this: "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

Do you really need .svc-extension in the rest url?

This might solve the problem: http://west-wind.com/weblog/posts/570695.aspx