简体   繁体   English

我可以并排部署两个ASP.NET(MVC和WebApi)应用程序吗?

[英]Can I deploy two ASP.NET (MVC and WebApi) applications side-by-side?

I am working on an ASP.NET project. 我正在研究ASP.NET项目。 We have two main projects, and MVC website, and a WebApi2 application that it uses to interface with the datebase. 我们有两个主要项目,一个是MVC网站,另一个是用于与日期库交互的WebApi2应用程序。 All of the routes of the WebApi2 application are something like "/api/Entity" I would like it so that our main MVC site that users are actually hitting will be hosted in the domain root (ie. www.example.com), while being able to access the api at "www.example.com/api/Entity". 我希望WebApi2应用程序的所有路由都类似于“ / api / Entity”,以便用户实际访问的主要MVC网站将托管在域根目录(即www.example.com)中,而能够通过“ www.example.com/api/Entity”访问api。 Is there a way to do that without doing a bunch of IIS configuration, or changing my routes? 有没有办法完成一堆IIS配置或更改我的路由?

  1. You can place them in the same project. 您可以将它们放在同一项目中。
  2. You can create an application within IIS called api and change the route definition in the api project to remove the /api/ . 您可以在IIS中创建一个名为api的应用程序,并在api项目中更改路由定义以删除/api/ Doesn't seem like a bunch of configuration/changing routes. 似乎不是一堆配置/更改路由。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM