简体   繁体   English

是否可以在Visual Studio 2015的其他端口中发布asp.net Web API? IIS不是IIS Express

[英]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. 当您在“站点绑定”菜单上时,可以单击“添加...”,然后选择类型和端口号。

Edit Bindings 编辑绑定

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET 4.6 WEB API,不提供静态文件(.js,.css)IIS Express Visual Studio - ASP.NET 4.6 WEB API, Not serving static files(.js, .css) IIS express visual studio 无法使用Visual Studio 2015使用IIS Express调试ASP.NET 5 - Unable to debug ASP.NET 5 using IIS Express with Visual Studio 2015 无法调试在Visual Studio 2015上开发并托管在IIS上的asp.net Web应用程序 - Can't debug my asp.net web app developped on visual studio 2015 and hosted on IIS ASP.NET Web API 在 IIS 中发布时不起作用? - ASP.NET Web API does not work when publish it in IIS? IIS Express“指定的端口正在使用中”Visual Studio 2015 - IIS Express 'The specified port is in use' Visual Studio 2015 ASP.Net Core Web API 适用于 IIS Express,但在部署到 IIS 时不起作用 - ASP.Net Core Web API works on IIS Express, but not working when deployed to IIS 我的 ASP.NET Web 应用程序在 IIS express 上正常运行,但在我发布它时却没有 - My ASP.NET Web application runs normally on IIS express but not when I publish it 无法从IIS(内部服务器500)使用Visual Studio 2015运行简单ASP.NET MVC应用程序 - Cannot run Simple ASP.NET MVC Application with Visual Studio 2015 from IIS (Internal Server 500) 在IIS上安装ASP.NET Web API - Installing an ASP.NET web API on IIS ASP.NET MVC Web应用程序未在IIS Express 10.0中定义的端口上运行 - asp.net mvc web app is not running on defined port in IIS express 10.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM