Is it possible to host a WCF webservice in IIS without changing IIS?
I've created a webservice for a customer, but their webserver administrator doesn't want to run "ServiceModelReg.exe /i /x" to install wcf on iis. He feels they need to test all their hosted websites again and that's out of the question. He doesn't mind adding the mimetype "svc", is there a way to configure the rest in the webserv开发者_C百科ice config file? As an alternative, are their any good resources to help met convince the administrator installing wcf is not scary? (or is it?) Is self hosting it in a windows service or console app the only solution to this problem?
Edit: I Forgot to mention the web server is MS Server 2003 and the .NET version is 3.5
It is perfectly harmless to run this command - all it does is register the scriptmaps so that svc gets processed by the right handler.
You can read more here, and if you want to do it manually for this site, then you can take a look at http://technet.microsoft.com/en-us/library/cc754147(WS.10).aspx or just use the IIS handler mapping interface.
For Integrated mode, you would add System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
as the *.svc handler,
for regular mode, you just pass it off to aspnet_isapi c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Note: Adjust for your preferred .net version.
精彩评论