7

I am stuck here in deploying my application to the local IIS server.

First of all my system doesn't have IIS manager then I get this by adding features to windows to enable that.

My IIS manager is IIS express 8.0 and using windows 10 with visual studio 2012

Now the problem is:

I created a web application and wants to deploy it in Local IIS server as: Right click on Project in VS->Properties->Web->and selected local iis server radioButton

But got the error in result as

The site for the Url.... exists on both local iis web server and the iis express web server. You need to edit the applictionhost.config file to change the port number used by iis express or change the bindings in iis manager.

How can I deploy my application to the local IIS server?

Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
hemantsharma
  • 537
  • 1
  • 5
  • 12

4 Answers4

7

You have to check the URL you are trying to deploy matches a binding in your local IIS.

For example if you are deploying to http://localMachineName/yourapp you should have a WebSite on IIS that has the binding created to

  • Hostname:LOCALMACHINE or *
  • PORT:80(in this case)

The most common case is that you use localhost as server name, so check you have the binding:

  • Hostname: localhost or *
  • PORT:80(in this case)

In other words, Visual studio connects to your IIS looking for a binding that should exist.

Also check you execute VS as administrator.

X.Otano
  • 2,079
  • 1
  • 22
  • 40
5

You need to create a Website binded 80 port.

  1. Open IIS manager
  2. Right click sites, add website
  3. Site Name: Website Pyhsical path: C:\inetpub\wwwroot Host Name: Leave blank IP address: All Unassigned Port: 80
  4. Open VS as administrator
  5. Go to your project properties > web > server > local iis
  6. And now click create virtual directory. It's will be work :)

We have created firstly main Website on iis and we created sub website on visual studio has bind it to main Website.

c3h4n
  • 145
  • 2
  • 9
1

Delete this file in your root project folder (or back it up)

.vs\config\applicationhost.config 

Empty the IISUrl tags in your project file (if there is one)

<IISUrl></IISUrl>

Go to project properties and try to create your virtual url again.

Jeremy A. West
  • 2,162
  • 4
  • 27
  • 40
0

You have two database connections using the same port.

The site for the Url.... exists on both local iis web server and the iis express web server. You need to edit the applictionhost.config file to change the port number used by iis express or change the bindings in iis manager.

You need to change the port number being used by IIS express. This answer gives good instructions.

Using right mouse clicks on solution explorer. I'm sure you'll have no issue with this. I think this is the easier solution than changing the bindings in your code. But that is another option.

Community
  • 1
  • 1