Home > Blockchain >  how do I publish a WCF service to IIS?
how do I publish a WCF service to IIS?

Time:09-17

At this point I have a WCF Service working using Cassini/IIS Express with a .NET client when I run it from Visual Studio, but am having difficulties when I try to publish it to directly IIS. For some reason I cannot connect to the WCF Service. I have been researching how to publish by looking at these Microsoft online docs:

https://docs.microsoft.com/en-us/dotnet/framework/wcf/wcf-service-publishing

For now I am just trying to publish it locally, where I choose to publish it to the File System to C:\inetpub\wwwroot\GeoService but when I try to browse to the server I only get errors like:

BTW, I have tried browsing to these sites:

http://localhost/GeoService.svc

http://localhost/GeoService/

http://localhost/GeoService/GeoService.svc

Where I get errors like:

HTTP Error 404.0 - Not Found

HTTP Error 403.14 - Forbidden

Please note that the full source code is here:

https://github.com/john1726/WcfEndToEnd.git

What am I missing? Does anyone have any suggestions? TIA.

CodePudding user response:

Please note that I tried to perform the steps in the Microsoft online docs but I ended up having to update the server by going to Programs and Features -> Turn Windows Features on or off and selecting .NET Framework 4.8 Advanced Services where I enabled all options because the aspnet_regiis.exe -ir and ServiceModelReg.exe -ia commands are no longer supported:

  • ASP.NET 4.8
  • WCF Services

For WCF Services I turned on:

HTTP Activation
MSMQ Activation
Named Pipe Activation 
TCP Activation
TCP Port Sharing

Also I turned on Windows Process Activation Service:

.NET Environment

Furthermore, I had to turn on Directory Browsing by going to IIS Manager and navigating to MyServer -> Sites -> My Site and clicking on Directory Browsing and choosing Enable.

Another step I did was enable IIS 6 metabase by in the turning features on or off I went to Internet Information Services -> Web Management Tools -> IIS Metabase and IIS 6 configuration compatibility

See Error - Unable to access the IIS metabase

Thus the URL I ended up using was:

http://localhost/GeoService/GeoService.svc

  • Related