area9
area9

Reputation: 391

Publishing multiple projects for VS 2019

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

Answers (2)

suziki
suziki

Reputation: 14113

solution is use the virtual directory.

Follow by these steps:

1. Publish the main project.

enter image description here

enter image description here

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.

enter image description here

After get into the kudu, click the cmd here.

enter image description here

Then click site, wwwroot. create a new folder under this directory. What I create is 'test111'

enter image description here

After finish the steps above, go to the Configuration of your website.

enter image description here

Go to path mappings tag to add the virtual directory. This is my settings:

enter image description here

3. deploy other project under the same website.

add the virtual directory you add above to the below options:

enter image description here

Save and publish.

If you want to deploy more project, just repeat steps 2 and 3.

Upvotes: 5

Alex
Alex

Reputation: 114

  1. If you have several projects in one solution, for example, MVC + WebAPI -in this case, each project needs own deploy domain.
  2. If in your case MVC + some libs which used by this MVC - in this case just deploy MVC, all required libraries will be deployed automatically.
  3. For Azure SQL DB you can read documentation here

Upvotes: 4

Related Questions