Kappacake
Kappacake

Reputation: 1937

404 On existing .svc file

I have an IIS site on a Windows 2012 R2 server. The site has an Application inside it:

IIS folder structure for the site

The URL for this site is setup on our Active Directive servers as it is only accessible internally from our company. The URL follows the following structure:

http://NAMEoftheSERVICE.myCompanyServices.myCompany.local

The service for this site is placed in an internal folder:

http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc

I have placed a number of test files both at the root level and in the internal folder:

http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/HelloWorld.html http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/HelloWorld.html

I can browse these files without any problems. However, I cannot browse the service at http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc

The browser returns Browser error screenshot

However the file is there, and I have made sure there are no typos in the URL I put in the browser.

I have looked at similar questions but there seems not to be anything like the problem I am experiencing. The only question that looked promising was: WCF service file not visible But the answer for that post does not apply to my issue as I already have the configuration mentioned in that post setup as it is suggested.

I have checked the IIS-level config files for any exclusion regarding .svc files or anything similar, but could not find anyhting.

Have you got any suggestions on where to look at to solve this issue?

Upvotes: 1

Views: 2204

Answers (1)

Kappacake
Kappacake

Reputation: 1937

Solution: Install HTTP Activation feature

After running some more testing on other sites on the same server, I actually realised that the issue was specific to .svc files. I therefore made another search on Google and found that the server was missing the "HTTP Activation" feature (part of the WCF Services).

So, if you are having the same issue on .svc files follow the following steps to make sure you have the right components installed on the server:

  • Open Server Manager
  • In Server Manager, click the Manage menu, and then click Add Roles and Features
  • In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  • Skip the Server Roles page.
  • On the Select features page, expand ".Net Framework 4.5 Features", expand "WCF Services" and select "HTTP Activation". Click Next. HTTP Activation module on the Server Manager
  • On the Confirm installation selections page, click Install.
  • On the Results page, click Close.

The same can be achieved by running the following Powershell command:

Install-WindowsFeature -Name NET-WCF-HTTP-Activation45

This did the trick for me. I hope it can be of help to someone.

Upvotes: 3

Related Questions