I currently have a website and a couple web applications that were handed over to me from someone else. The web applications are subdirectories of the website (so the final URL would be www.mywebsite.com/app1). We just got the new website up and running on our new server, and while the subdirectories are there, the applications within do not work, so I need to republish the applications to those subdirectories (some edits were made). When I try to publish though, all the folders and files publish underneath the root directory instead of the subdirectories where they belong (and I get an internal server error 500.19 because it doesn't like the app's web.config file it is now reading - an issue for another time). So, I have two questions, and I'm using the Web Deploy method in Visual Studio 2019 on a .NET Framework 4.8 app:
How do I make sure when I publish that it finds the right folder to publish to?
I know I need to "convert to application" the folders in the IIS Manager. Do I do that before or after I publish the app to that folder?
Currently, my root directory looks like this and this is the result I need after publishing. FocalAreas, Inventory, and NatiVeg are all self-contained .NET applications with their own Global.asax files, web.config files, packages.config files, etc.
Do I need to set something up in the publishing profile to point to the right folder for publishing? I didn't see much I could configure there for web deploy. I looked at a bunch of stackoverflow questions and youtube videos, but I couldn't find any that just laid out the basic workflow of publishing apps in subdirectories via web deploy. Most of them are speaking to the IIS Manager side of things, after they've already published to their subfolders. When reading among the various posts, I did see that there was "add virtual directory" as well; is that something I would need to do before converting to an application? TIA.
This turned out to be a pretty simple fix:
Let's say I have a site named DogsAreAwesome and a folder that I want to contain my application called Doberman.
In IIS Manager, convert the Doberman folder you want to publish to under your top-level site (DogsAreAwesome) to an application. Right click on the Doberman folder > Convert to application.
Set up your publishing profile in visual studio to point to the new Doberman app you just set up. This was the part I was missing. Where it says "Site Name" in the connection dialog box, put not only the top-level site name (DogsAreAwesome), but also the folder which you converted to an application in step 1 (Doberman): DogsAreAwesome/Doberman
Now when you publish using web deploy, it should publish your application files to that Doberman folder (which is now an application), not the whole DogsAreAwesome website.