I just created a WCF Service application project using VS 2010.
Nothing complicated, I just built the template that VS provides and pressed F5.
After this I am able to see the service hosted on IIS on a specific port. Pressing F5 results in the directory listing of the root directory of localhost. I click on the .svc file I get the message about svcutil.exe etc.
But my next step was to try and publish the app to localhost through the file system as this is how my web service will be deployed on to our production server.
So right click on the project name in VS2010 and click on "publish", create a new profile, publish to "file system", gave a local folder name on my c: drive, selected Debug for configuration and published the service. This produced the web.config, .svc file and a bin folder with the .dll and the .pdb files. After this I copied these files to my c:\inetpub\wwwroot\ folder. Deployment - done!
But after this step I am trying to see if my service is running on my localhost, so I type http:\\localhost\Service1.svc
. this produces the error
Server Error in '/' Application.
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The most common solution for this error on the net is registering asp.net on IIS using aspnet_regiis.exe -iru, but this gives me the error
This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlink/?LinkID=216771.
. So I opened Turn On/Off windows features and checked if ASP.NET is installed. My IIS settings are as below:
. But no success with seeing my .svc file in the browser.
In another attempt, I dropped a simple .htm file under my wwwroot folder and tried to access it through my browser.
But I get the same error when I try to see my SVC file.
Where am I going wrong? What is the right way to host a WFC service created as a WFC Service Application on IIS via the file system? Is my way of testing correct?
How do I fix the error that shows up on my localhost browsing?
Environment: I previously had VS2008, currently have VS2010 and VS2013 RC on my machine which is a Win 8 64-bit OS, which I believe runs IIS 8. And I have reset IIS using iisreset just to see if that helps. but to no avail.