[英]Is it possible to publish asp.net web api in a different port in Visual Studio 2015 ? IIS not IIS Express
My goal is to publish web api in IIS. 我的目标是在IIS中发布Web API。 I will call this web API from android application. 我将从Android应用程序调用此Web API。 I'm using IIS not IIS Express and xamarin in visual studio 2015. I'm very confused that IIS express comes with a port no in project properties ( http://localhost:57811/ ). 我在Visual Studio 2015中使用的是IIS,而不是IIS Express和xamarin。我很困惑IIS Express在项目属性中带有端口号( http:// localhost:57811 / )。 If I change it to IIS, I no longer able to specify a port number (both in 2012 and 2015). 如果我将其更改为IIS,则无法再指定端口号(2012年和2015年均如此)。
So I check "Override application root URL" and have put port no in it. 因此,我检查了“ Override application root URL”,并在其中放置了端口号。 After publish my web api not listening to the port no I mention, Instead its looking at default port no. 在发布我的Web API后,我没有提到端口号,而是在查看默认端口号。 Can anybody explain how this is happening ? 谁能解释这是怎么回事?
You can add an available port by going into IIS, drilling down on your ServerName, Sites, right clicking on your SiteName (Default is: Default Web Site) and selecting "Edit Bindings...". 您可以通过以下方式添加可用端口:进入IIS,在ServerName,Sites上展开,右键单击SiteName(默认为:默认网站),然后选择“ Edit Bindings ...”。
When you are at the "Site Bindings" menu you can click "Add..." and then chose the type and the Port Number. 当您在“站点绑定”菜单上时,可以单击“添加...”,然后选择类型和端口号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.