Reputation: 391
Publishing 1 project in Microsoft Azure is great and amazingly simple. However, how do I publish a solution with multiple projects (I have an C# ASP MVC web + 3 class libraries + database)? I cannot figure this out and guess that I am really stupid or just missing the obvious. I have a free trial with Azure - does this impact whether I can do this? Please could a Visual Studio 2019 example please be provided. I read a lot about virtual directories, but I still do not get how to upload the other projects. Tried Deploy multiple project solution to azure, https://learn.microsoft.com/en-us/azure/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy and https://social.msdn.microsoft.com/Forums/en-US/fad89061-935d-49b5-9839-4e4f76ce44c5/publish-solution-with-multiple-projects?forum=winformssetup.
Upvotes: 6
Views: 10429
Reputation: 14113
solution is use the virtual directory.
Follow by these steps:
1. Publish the main project.
When deploy the main project, just use the default is ok. Without anything modify, it will be deployed to site\wwwroot.
2. set the virtual directory.
We all know web app will be deploy to site\wwwrootby default, so lets create a sub directory under this to deploy the new project.
Go to the Kudu of your website.
After get into the kudu, click the cmd here.
Then click site, wwwroot. create a new folder under this directory. What I create is 'test111'
After finish the steps above, go to the Configuration of your website.
Go to path mappings tag to add the virtual directory. This is my settings:
3. deploy other project under the same website.
add the virtual directory you add above to the below options:
Save and publish.
If you want to deploy more project, just repeat steps 2 and 3.
Upvotes: 5
Reputation: 114
Upvotes: 4