views:

543

answers:

1

Hi ,

I have WCF service folder let's say : "TestService" and it contains following folders and files under TestServide folder:

TestService folder contains: 1.bin (folder) 2.Config (folder) 3.TestService.svc (file) 4.WebConfig (file)

when I go to InetMgr and try browsing the TestService.svc file, the wcf service opens successully: path: https://localhost/TestService/TestService.svc

qusetion

I cut and paste two files ( TestService.svc and WebConfig ) under bin folder. Now the folder heirachy changes as follows:

TestService folder contains: 1.bin (folder) contains a).TestService.svc (file) b).WebConfig (file)

2.Config (folder)

Now again I go under bin folder and open TestService.svc to open iexplorer it does not opens and gives following error.

path:https://localhost/TestService/bin/TestService.svc error:page cannot be found Technical Information (for support personnel) Background: You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed. More information:

Do I need to change anything so that my svc file will work??

+2  A: 

If your web.config and TestService.svc are now in TestService/bin, you'll need to create an IIS web application pointing to that location.

You cannot have an IIS web application (virtual directory) pointing to "TestService" and then have your web.config and TestService.svc in a subdirectory of that IIS web app.

The IIS web app must point to the physical path where to web.config is located, and the *.svc files must be there in that same directory (not a subdirectory!), too.

Marc

marc_s
Can I change the path of existing wcf service application such that it will point to bin folder?I have doing this by going to properties page of TestService ( Propeties-> Web) . On "Use Local IIS Web Server" I changed the path to http://localhost/TestService to http://localhost/TestService/bin .But in that case virtual directory is created different heirarchy.
Ashish Ashu
Yes you can - you need to use the IIS Management Tool for this. Inside the IIS Mgmt Tool, you can view your virtual directories / IIS webapps and change their properties, including the physical path they point to.
marc_s
I have already mapped the virtual directory through IIS Management Tool but stil when I move the svc file in the subdirecotory , it will give error.
Ashish Ashu
if the svc file is under TestService folder it runs successfully but when I move the svc file in bin folder I am not able the svc page gives error ( The page cannot be displayed)
Ashish Ashu
The *.svc file **MUST** be in the directory your IIS webapp points to - it **cannot** be in a subdirectory!
marc_s