I have just begin using ASP.Net Web application in Visual Studio. What I want to know is that I have two web pages namely index1.aspx and index2.aspx. I want to host them separately using different port numbers in local host on the iis server. I know site binding is used in these cases but not sure how to go about it.
What is the best way to do this? I want them to run simultaneously and communicate between each other.
In IIS there is something called Virtual directory. You can create two web applications in IIS and make both pointing to same physical location on your system.
You can also update settings of each web application to have different index pages. i.e. web app1 shall use Index1.aspx as index page, and web app 2 shall use Index2.aspx.
Virtual directories are so cool, you can use the same code base for multiple tenants. All we have to create is new web apps or sites in IIS.
So I solved it like this:
I created two projects WebApp1 and WebApp2 in the same Solution.
Right Click on Solution Explorer--> Properties--->Select the radio button with Multiple Startup projects.
Also make sure The Action of atleast one of the projects is set to Start only . The rest can be Start Without Debugging.
To connect IIS to your web application say webapp1:
Reference this video:
https://www.youtube.com/watch?v=IwbKquNBNgQ
Hope this helps anyone who is trying this out.
Related
Background
I have two separate projects in my solution. One of them (the web application project) is responsible to show the landing page (on the root of the domain, say www.example.com) and a documentation for the API (say www.example.com/documentation).
The other project is responsible for the API itself. It's path must be www.example.com/api/v1/ to ensure compatibility with our previous software.
We made this way to be able to publish updates to any of the projects without the need to publish the entire solution, and of course, for organization.
Problem
I don't get how to configure the applications to run on Azure on the same domain with different routes, and I'm stating to fear that it is not possible.
I already tried to configure a subdomain (say api.example.com/v1), but it can't be done because we will break the compatibility with our current clients.
This question is almost what I'm looking for, but it does not show how to do on Azure, and this one is on Azure but using subdomains.
First: you have to create 2 folders, 1 for your web api and the
second for your web app
second: you have to set the two folders as an application.
after doing those two steps you can acces to the two folder by puting:
www.yourdomaine.com(or another)/nameofyourfolder
good luck
It's been incredible exhausting for me, after passing a week to deploy MVCForum (Source Code) to my Azure Web App. I've read that it was possible if you selected a different path when publishing, something that I did. But when I tried running, my main app and the MVC Forum were conflicting between them.
I'd like to use Azure's Web Apps instead of Azure's Cloud Services because of the simplicity and the possibility of only uploading the files that have changed. I have seen that it is possible to upload Web Api and MVC in that fashion, but I have not found an example that sends 2 different MVC apps into a same Web App.
Is it possible to do it with 2 different MVC apps? (Note: Areas are not an option, since the MVC Forum Source Code resides on a completely different solution)
Thanks!
Given your comment that you are trying to work with separate deployments:
A Web App under the same name (e.g. myapp.azurewebsites.net) is going to be managed by a single deployment. That is, if you have two github repo's (or two dropbox folders, or two of anything) and try to push up new content from deployment B, you'll effectively wipe out deployment A.
You can certainly have multi-path apps running in the same deployment, but they'd need to be part of a single distribution (e.g. single github repo). Otherwise, you'd need multiple deployment slots (e.g. app-a.azurewebsites.net and app-b.azurewebsites.net).
Maybe you can use virtual directory to upload multiple app projects in single webapp, this article explained it
Create projects
Assign virtual directory
Publish the root project
Set up virtual directory in azure portal
Publish the child projects
In my organization, there is a process where in for every new website/application to be added into the IIS, we have to go through a 6 weeks complex process and waiting. Even after the process completes the team will not have access to IIS. We can only deploy the build files using TFS, web deploy etc.
I have initiated the process for my first application/site in the IIS. I wanted to know if there is a way I can avoid future request/process for new application, by making this upcoming application an application of applications :). Something like child applications. But remember I do not have IIS access. I still have access to my application's web config. I also have the freedom to manage URL structures/patterns.
Either by using multiple routes, multiple projects etc. Just thinking loud. My applications will be of type web api, mvc etc
Any crazy ideas? Thanks in advance.
You can have several application roots in IIS, which can be virtual or real directories, under the same site.
Those separate applications will have separate configs and will not inherit each other's settings.
You can access your apps under the same domain, or to be configured to use different domains
http://www.domain.com/app1, http://www.domain.com/app2
They can share the same app pool or be configured to use different.
Since you don't have an access to IIS, I'm not sure how would you configure the app pool or domain, but perhaps Microsoft.Web.Administration namespace will help doing this from code. It contains managed classes to manage all aspects of IIS, including the configuration . It can be used from .Net or from PowerShell.
Creating Sites and Virtual Directories Using System.DirectoryServices
Using IIS Programmatic Administration
I'm trying to configure a websetup for the first time for our ASP.NET application which consists of 11 web services. Is it possible to create an msi that will install the app and the 11 web services and also set-up the app pools & create the apps in IIS? Or would I need an individual setup for each web service? Basically I need to make it as simple as possible for the client to release. Thanks for any help
I am not sure you can because the setup wont allow you to pick different root folders. But you could create one for each then mesh them together with something like this.
http://www.codeproject.com/KB/install/dotNetInstaller.aspx
i am new in asp.net i dont know to how to combine two asp.net web site into one like domain and subdomain concept.
i know the procedure to host one web application in local iis. Please explain the how to combine two application and how to host in local iis i.e) single url as domain(one web application) and subdomain(another web application).
The url should be like these:
http://localhost/firstapplication/
http://localhost/secondapplication.firstapplication/
Thanks in advance.
I'm not 100% sure I understand your question but I think what you want to do is setup a host header for 2 different applications so that you can access them from the same IIS instance. Here is an article that shows you how to configure the hosts:
Using Host Headers to host multiple websites on IIS 6.0
If you are testing this locally you probably want to make a host file entry to simulate the environment.
If you want it to be localhost/firstapplication and localhost/secondapplication.firstapplication/ then you could create a virtual for each application. Here is how you can do that:
How To Create a Virtual Directory in Internet Information Services (IIS)