WCF and WebGet - Error when requesting files with extension
I have configured a simple method in my service that just sends back what you requested :
[WebGet(UriTemplate = "/{fileName}")]
[OperationContract]
string GetFile(string fileName);
And when I access this method via:
http://localhost:8460/WCFService1/Service.svc/file开发者_开发知识库Name I get a respond containg the string "fileName". But I want to be able to accept a request for a file with it's suffix like this : http://localhost:8460/WCFService1/Service.svc/fileName.jpg In this case I get an error : The resource cannot be found (As if the request was not channeled to the GetFile() method).It's a bug with the asp development server. When I host the service in webmatrix(IIS express) it works fine and requests made with extensions are ok.
精彩评论