简体   繁体   中英

ASP.net mvc routing with multiple sites under the same route url

Good morning,

I have a fairly large MVC project with 30/40 controller and a lot of views, i am trying to publish on IIS using multiple application so i can split various sites per different customer.

I want to use my landing page as the base url:

https://somewebsite

I then want to host multiple applications (eg the same project with different config) as separate applications but under the same main host name.

https://somewebsite/Customer1 https://somewebsite/Customer2

Now i can get my multiple websites fine under the seperate host as application, but when i add my landing page (as the full application) its corrupting the other two sites.

My thoughts are that the routing in the route app (the one i want just for landing page is causing the issue).

Any ideas?

If you are deploying via WebDeploy it will delete subfolders under the host site if they are not part of the host application. You can disable this behavior however with a MSBuild argument:

/p:SkipExtraFilesOnServer=true

OR during the MSDeploy deployment using the following argument:

-enableRule:DoNotDelete

http://www.dotnetcatch.com/2016/02/01/webdeploymsdeploy-quick-tip-keep-existing-files-during-deployment/

The issue lay within the web.config of the applications. The config was being inherited from the master site and causing issues across the board. Set the clear attributes in the child application config and all is well with the applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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