TheIronCheek
TheIronCheek

Reputation: 1139

IIS 8.5 - Change the port my web service application runs on

I have an ASP.NET web service application that I want to run on a port other than port 80. I found this article on binding:

http://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding

But I can't figure out how to implement it properly. The GUI method it describes seems the easiest but step 3 says:

  1. In the Actions pane, click Bindings...

As you can see, that option doesn't exist for me (IIS 8.5):

enter image description here

They also provide this configuration sample:

<site name="Contoso" id="2">
   <application path="/" applicationPool="Contoso">
      <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
   </application>
   <bindings>
      <binding protocol="http" bindingInformation="192.168.0.1:80:www.contoso.com" />
      <binding protocol="https" bindingInformation="*:443:" />
   </bindings>
</site>

I'm assuming that goes in the web.config? I get a configuration error that says Unrecognized configuration section system.applicationHost when I add it like this:

<?xml version="1.0"?>
<configuration>
  <appSettings/>
  <connectionStrings/>
  <system.applicationHost>
    <sites>
      <site name="MyWebService" id="1">
        <bindings>
          <binding protocol="http" bindingInformation="*:443" />
        </bindings>
      </site>
    </sites>
  </system.applicationHost>
<!-- more stuff I didn't mess with beyond here -->

But when I remove the system.applicationHost tag, I just get a different error. What am I doing wrong?

Thanks!

Upvotes: 0

Views: 1784

Answers (1)

Pankaj Kapare
Pankaj Kapare

Reputation: 7792

  1. Most certainly screenshot in question is taken when active node in left pane is your web service and not website under which your application is hosted. You can modify bindings at website level and not web application level. First select website in left pane under which you web service resides and you should be able to modify bindings. But please note that modified bindings will be applicable for all web applications hosted under that website.
  2. You can modify bindings in config file but these settings resides in applicationhost.config file located at C:\Windows\System32\inetsrv\config.

You can choose either of above options to achieve what you want.

Upvotes: 2

Related Questions