How to serve files and html directly from a WCF-service similar to an ASHX-handler?
Im writing an install and update-server for an intranet-application and I want the user to be able to install the app directly from a url such as: http://doma开发者_如何学Pythonin.local/myapp/install.exe where this request is handled by my service.
I also would like to be able to serve some basic HTML on for instance http://domain.local/myapp/status.html which is generated on the fly by my WCF-service.
Is this possible? Im using a self-hosted WS-binding WCF-service with .NET4/VS2010 on WS2008R2.
Ive found the solution! WebGet in System.ServiceModel.Web. I had to change the project target from .NET 4 Client to .NET 4 for the System.ServiceModel.Web.dll to turn up in "add reference"
精彩评论