Reputation: 404
I have multiple APIs that use the same port (8888). These APIs are part of different solutions.
....
When I run any of the APIs in visual studio 2013 (hit F5), iis express starts and all of the APIs are running. This happens even though the APIs are part of different solution. I can see them when I click on the iis express icon under View Sites.
I installed VS 2015 and when I run one API in visual studio the other APIs do not run. I cannot even run the other APIs in the other solution since I get:
unable to launch iis express.. port is in use
how can I get the other APIs to run when I run any API? I need to mimic the behavior that exists in VS 2013 in VS 2015.
Thanks.
Upvotes: 9
Views: 12937
Reputation: 63173
If you do want the old behavior, use global application host file in your project file please,
<UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile>
http://blog.majcica.com/2018/03/15/using-global-application-host-file-in-visual-studio-2015/
Upvotes: 2
Reputation: 43
Update to this in Visual Studio 15+ the IIS config folder is in the projects hidden .vs folder [ProjectFolder]/.vs/[ProjectName]/config/applicationhost.config Other than that, Ivor's Answer still worked for me.
Upvotes: 3
Reputation: 136
I solved this for a similar scenario, although in my case I chose to run IISExpress via the command line and passed through the config file as an argument.
As an example, I have two applications that I want to host simultaneously on port 80 on localhost:
<sites>
<site name="test" id="1" serverAutoStart="true">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath" />
</application>
<application path="/api1" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath\api1" />
</application>
<application path="/api2" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath\api2" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:localhost" />
</bindings>
</site>
<!-- other settings relevant to your installation of IISExpress-->
</sites>
The key things I had to do to get this working was:
Upvotes: 6