简体   繁体   English

将多个项目部署到同一IIS网站

[英]Deploy multiple projects to same IIS web site

I have a complete solution with multiple projects (repository, services, helpers, etc.) and in particular one executable project WebAPI and another called Web. 我有一个包含多个项目(存储库,服务,帮助程序等)的完整解决方案,尤其是一个可执行项目WebAPI和另一个称为Web的项目。 Ideally I would like to deploy everything to the same IIS website but having the WebAPI using 理想情况下,我想将所有内容都部署到相同的IIS网站,但要使用

www.mysite.com/api/routes

and the regular Web (which is a SPA using the API) 常规网络(使用API​​的SPA)

www.mysite.com/home

So both projects have seperate controllers but should be on the same website (but one in a subfolder). 因此,两个项目都有单独的控制器,但应位于同一网站上(但一个子文件夹中)。

I just don't really know how to setup the IIS. 我只是真的不知道如何设置IIS。 I was trying to create multiple website, but that doesn't work, since I can't set a subfolder (/api). 我试图创建多个网站,但由于无法设置子文件夹(/ api),因此无法正常工作。 Virtual Directories don't work, since I cannot deploy seperately onto a virtual directory. 虚拟目录不起作用,因为我无法将其单独部署到虚拟目录中。 Any advice? 有什么建议吗?

I disagree with this statement: 我不同意以下说法:

Virtual Directories don't work, since I cannot deploy seperately onto a virtual directory. 虚拟目录不起作用,因为我无法将其单独部署到虚拟目录中。

When creating a virtual directory you create a path in the main website which points to a webroot. 创建虚拟目录时,可以在主网站中创建一个指向Webroot的路径。 That webroot can (and should be) outside the main websites webroot. 该webroot可以(并且应该)在主要网站webroot之外。 This means you can deploy either the SPA or API independently by targeting the aapropriate webroot. 这意味着您可以通过定位适当的webroot来独立部署SPA或API。

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

相关问题 在同一解决方案中将多个.Net Core Web项目部署到多个Azure App服务 - Deploy multiple .Net Core Web projects in same solution to multiple Azure App services 如何通过Web部署在Visual Studio中部署网站项目? - How do I deploy Web Site Projects in Visual Studio via Web Deploy? 从多个Web项目构建一个Web部署程序包 - Build a single web deploy package from multiple web projects 在同一个解决方案中将 Asp.Mvc 和 Web.Api 部署到 IIS - Deploy Asp.Mvc and Web.Api in the same solution, to IIS 多个Web项目,(几乎)Visual Studio中的相同布局 - Multiple web projects, (almost) same layout in Visual Studio 在同一解决方案中分别部署两个ASP.NET Web API项目 - Deploy two ASP.NET web api projects in the same solution separately 在Web Deploy上自动备份网站 - Automate a backup of web site on Web Deploy 如何在单个MSI中部署多个项目? - How to deploy multiple projects in a single MSI? 我应该在一个解决方案中有多个项目,还是对于共享同一数据库的控制台和Web应用程序有多个解决方案? - Should I have multiple projects in a Solution or multiple Solutions for a console and web application that share same database? 使用多个项目发布Web应用程序 - Publish Web Application with Multiple Projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM