mscommunity.net

Interactive mscommunity.net online activities
Signed in as anonymous | Edit Profile | Sign out | Help
in Search

Weblog :: Boris Ševo

Sporadic posts about my interests, e.g. software development (mostly .NET), technology in general and some occasional rant.

Hosting WCF services in IIS7 and Windows Vista

 Today I spent almost 2 hours trying to run a WCF service hosted in IIS7. After I read a lot of blog and forum posts I finally got a solution which works. Basically, you just need to do this four steps:

 Step1: Change the C:\Windows\System32\inetsrv\config\applicationHost.config file. You must add handlers section and one mimeMap tag.

....
<location path="Default Web Site" overrideMode="Allow">
<system.webServer>
<asp />
<handlers>
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode" />
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>
 
</system.webServer>
</location>
...
<staticContent>
...
<mimeMap fileExtension=".svc" mimeType="application/octet-stream" />
...
</staticContent>

Step2: Then you should run servicemodelreg with a -i option:
      C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>ServiceModelReg -i

Step3: Turn a Windows Communication Foundation HTTP Activation feature on. Go to Add/Remove programs, Turn Windows Features on/off and install Windows Communication Foundation HTTP Activation (it is in a Microsoft .NET Framework 3.0 section).

Step4: Go to IIS Manager and add new application to your web site (you must choose Add Application ... option, I also tried with a Add Virtual Directory ..., but it didn't work for me) which physical path will point to your WCF service.

 

That's all. I hope it will help you if you run in a similar problem.
 

Published lis 30 2007, 07:48 by boris.sevo
Filed under: ,

Comments

 

colmac.NET said:

Host WCF Services in IIS7 and Vista

veljača 20, 2008 12:08
 

anonymous said:

Very Helpful

srpanj 24, 2008 12:40
 

anonymous said:

Brilliant, thank you so much.

lipanj 27, 2009 2:43
 

boris.sevo said:

I'm glad that it helped you.

lipanj 27, 2009 7:10
 

Host WCF Services in IIS7 and Vista « colmac said:

Pingback from  Host WCF Services in IIS7 and Vista &laquo; colmac

srpanj 1, 2009 12:01
 

anonymous said:

Thanks for the useful posts

Regards,

listopad 14, 2009 5:27
 

anonymous said:

thanks. this saved my time

studeni 3, 2009 7:09
 

anonymous said:

I did precisely as explained in the blog, however I get the contents of the svc file when I use the url like this localhost/.../service.svc

any ideas?

prosinac 14, 2009 11:00
 

boris.sevo said:

Sorry, I just uninstalled Vista 2 days ago. Although I have a fresh installation of Windows 7, I didn't have time to try it out. At this moment I'm not able to help you because I can't repeat the steps from the blog.

prosinac 14, 2009 2:08
 

Host WCF Services in IIS7 and Vista « colmac.NET said:

Pingback from  Host WCF Services in IIS7 and Vista &laquo; colmac.NET

veljača 19, 2010 2:37

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems