locked
publish two related projects in iis RRS feed

  • Question

  • User-1548796982 posted

    hi

    I have developed a web application using .net mvc and WebAPI as follows:

    SOLUTION
      |—— WEB.API Project  
      |—— Web Application Project

    wanting to deploy to my web server. It is possible to deploy both projects on a single web site (in iis)?

    Do I need to create two separate sites for the web application and web api (in iis)?

    Saturday, February 23, 2019 7:39 PM

All replies

  • User61956409 posted

    Hi tadbirgaran,

    wanting to deploy to my web server. It is possible to deploy both projects on a single web site (in iis)?

    Yes, you can host these two projects by a single web site on IIS. To achieve the requirement, you can try:

    Approach 1: create/add two applications to the web site, and the deploy your MVC and WebAPI projects to corresponding application.

    https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/application/#how-to-create-a-new-web-application 

    Approach 2: create/use virtual directory to host your MVC and WebAPI on one website.

    https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/application/virtualdirectory#setup 

    Besides, for IIS related questions, you can also post in IIS support forums.

    https://forums.iis.net/ 

    With Regards,

    Fei Han

    Monday, February 25, 2019 2:21 AM
  • User-1038772411 posted

    Yes you can do it with easy steps :

    Step 1 : publish your MVC project & WebApi Project from solution explorer 

    Step 2 : after successfully  published, Open IIS server in your computer.

    Step 3 : In the left pane, Under the "Site" Folder create Add website, First Give site name,than Physical path from your Local Published folder(MVC project now not use webapi project). and set your IP address and Port.

    Step 4 : After this now in the left pane, Right Click "Default Web Site" folder And Create "Add Application".

    Step 5 : In the add application popup give alias name, and "Application pool" please select that site name you created while you publish your mvc project. (step : 3, website name). Than give physical path (select Web-api project from local publish folder) Than Click ok.

    If these above simply steps you performed well you can easily run your site with api configuration on iis.

    Tuesday, March 12, 2019 11:24 AM