[英]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.