2

I have created asmx web service in PC1. Now I have coped this project to some other PC2. I have installed only IIS Express and .NET Framework.

I want to run web service in PC2 using IIS Express. Is it possible or not? Thanks!!

Nitesh Kothari
  • 890
  • 12
  • 27
  • This may help you, http://stackoverflow.com/questions/8735713/creating-virtual-directories-in-iis-express – Adil Feb 12 '15 at 07:37

2 Answers2

2

Under the IIS Express folder in the C:\Program (x86) folder there's the appcmd.exe. First you need to add a virtual directory with the follwoing command:

appcmd add vdir /app.name:<site_name>/ /path:/<virtual_directory> /physicalPath:<physical_location>

If there is no site you can add one by yourself:

appcmd add site /name:SITENAME /id:2 /physicalPath:C:\PHYSICAL_PATH /bindings:http/*:8080

If you want to install the Service on the Default Web Site (if there is one) you can use the following:

vdir /app.name:"Default Web Site"/ /path:/service /physicalPath:C:\PHYSICAL_PATH
Claudio P
  • 2,133
  • 3
  • 25
  • 45
  • Claudio, but port number of web site in my PC1 is "9090", will it work with port "8080" in PC2?? Thanks – Nitesh Kothari Feb 12 '15 at 07:51
  • If the existing site listens to port 9090 you should type 9090. Mine is just an example. But it's possible to configure each open port – Claudio P Feb 12 '15 at 07:53
  • Claudio, ok thanks brother!! Do I have to change configuration in application.config file?? Thanks for your time. – Nitesh Kothari Feb 12 '15 at 07:54
  • First code of adding virtual directory, that you showed, can you tell me about "path"? Will it be static? I understood the physical path. – Nitesh Kothari Feb 12 '15 at 07:59
  • And in the second code what about the value of "id"? @Claudio – Nitesh Kothari Feb 12 '15 at 08:00
  • it must be an id which isn't used yet. Usually there's a standard site with the id 1. So 2 should be free. – Claudio P Feb 12 '15 at 08:06
  • Ok brother, last one thing can you tell me?? What about "path" and "physical path" keywords? Thanks man @Claudio – Nitesh Kothari Feb 12 '15 at 08:09
  • Physical Path is the path to the folder were you're application is. Path is virtual and this is the path were you can access your service. For example: **localhost:9090/service**. Or if you type / as the path you can access your service via: **localhost:9090** – Claudio P Feb 12 '15 at 08:13
  • Ok, All I understood very well, so path and phsical path keywords are just for example. Is it right? @Claudio – Nitesh Kothari Feb 12 '15 at 08:17
  • Hello brother, I am not able to launch appcmd.exe from IIS Express. Whenever I launch it, it closes automatically within a second. What to do? Thanks @Claudio – Nitesh Kothari Feb 13 '15 at 09:08
  • Change the directory in your console to the folder where appcmd is. – Claudio P Feb 13 '15 at 09:10
  • Means copy the project folder to the IIS express folder? Is it so? @Claudio – Nitesh Kothari Feb 13 '15 at 09:12
  • No. Just change directory in your console to the directory where appcmd.exe is. On my pc it would be teh command: cd "C:\Program Files (x86)\IIS Express". After that you can call the appcmd command. – Claudio P Feb 13 '15 at 09:13
  • I am really sorry but I m not getting what are you trying to say? @Claudio – Nitesh Kothari Feb 13 '15 at 09:15
  • Or type instead of appcmd: C:\Program Files (x86)\IIS Express\appcmd.exe" or whatever the path is on your computer – Claudio P Feb 13 '15 at 09:16
  • I understand, my path is also the same one, but I am not able to launch appcmd.exe, how do I type? Claudio – Nitesh Kothari Feb 13 '15 at 09:19
  • I am trying open appcmd.exe directly but doesn't opening. It opens and closes within a second. – Nitesh Kothari Feb 13 '15 at 09:43
  • Ohh, means through command prompt, right? I thought these all I have to type in appcmd. Thanks @Claudio – Nitesh Kothari Feb 13 '15 at 09:46
0

Yes possible.

Steps for check:

  1. Whether that system is connected with LAN.
  2. You have to Set the IP address for PC2 in Edit Bindings(IIS)
Jehof
  • 34,674
  • 10
  • 123
  • 155
vignesh
  • 97
  • 5