Is it possible to run ASP.NET in IIS 7.5 without creating Virtual Directories or Applications? - asp.net

I have a Continuous Integration server with dozens of ASP.NET applications hosted on IIS. Everytime I want to deploy a new application, I have to create a new Website or virtual Directory and configure it as an application in IIS.
I would really love to have only one website listening in a specific port (say, 80) serving multiple ASP.NET sites according to wildcard host headers.
For instance:
*.dev.mydomain.int -> my server's ip address (eg: 192.168.1.32)
IIS web site reads the host header and try to find a local folder with the same name. Ex: when a request uses the host header "helloworld.dev.mydomain.int" IIS tries to open a preconfigured folder appending the host header site name (e.g: D:\dev\helloworld)
IIS serves the contents of the folder as an ASP.NET application, using preset configurations (Application Pool, ASP.NET version, and so on).
My goal here is not to create a web site or virtual directory for each and every project in our CI server. I know I can create them programmatically, but I'd prefer a more dynamic solution.
Thanks in advance

You can use MSBuild tasks to create Virtual Directories / Web sites automatically.
http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html
I had it working on a large application with many branches (we had an environment for each branch) and I didn't have to open IIS settings at all. Just pure hands-off process.

Related

How to create 2 asp.net web form applications in the same website each in different subfolder?

I'm creating multiple small ASP.Net Web forms applications i want on my host each project of those to run in different subfolders for the root directory of my host. When i puplish each project to different subfolders of the root directory all of them dont work. The only one that works is the one at the root directory. I think this issue is related to Web.Config. I want to ask is there a way to run each application of those in different subfolder without creating other websites ??
IIS
I have been doing this a lot for testing purpose before final deploy. I just host the new application in the virtual directory of the the existing website that we own.
for eg:- www.example.com is our site
and we have a application named xyz then url for new application will be : www.example.com/xyz
You have to add a virtual directory in the root of the IIS website and turn it into an application by right-clicking on it in the IIS management console.
Or simply you can put the website in your root website (as in your case) and then in the IIS management console convert that folder to application.
Create and Configure Virtual Directories
Setting Virtual Directories as Applications in IIS

ASP.NET deploy to IIS7: To default site root, app in default site, or separate site?

I'm sort of new to IIS7, and I sort of get the differences between sites, applications, and virtual dirs. However, I'm not quite sure what the best deployment approach would be for my specific situation.
I have a clean windows '08 server VM with a IIS/asp.net set up. I set up an FTP site with C:\inetpub\wwwroot as the FTP root thinking I could do a quick "copy site" from VS to this root.
However, before I do the copy, I want to make sure this is the quickest, safest approach.
Please note that, this VM will be soley dedicated to my asp.net app (for testing purposes), and I'm kind of under the gun having to get this app running by EOD today.
That said, my questions is, should I...
simply do a "copy site" directly to the default site's root and
leverage the default app pool that's already been created, or
add a new application under the default site (if I do this, should I select the default app pool, or create new ones), or
add a whole new web site?
Also, while I'm at it... My app was built with asp.net 4. Should I select the Default App Pool, or the ASP.NET 4.0 Integrated ones?
Thank you,
Ed
Here's how I would setup IIS:
Create a new site (I always name the sites by the domain that they will be using)
Creating a new site will create a new application pool. Verify that the application pool is using .NET 4.0 Integrated.
Copy/Publish your site to a folder and then host this folder.
IF you host it under default web site, your url to the site will be http:// machinename/sitename or http:// localhost /sitename
In the other case you will host your site directly on a specified port or you can even host it under :80 port, and will be accessible directly through your machine name. Choose the application pool that is in integrated mode with supported version of 4.0 and you won't have any problems ( usually default app pool is configured with these settings)

specify a domain when deploying on iis

I am deploying a web application to a windows server 2008 named jonny521 using IIS7. The domain for most applications on this server is jonny521 however one of the application's domain is jonny521.development.local and I'm not sure how the application got that domain. I want to deploy another application to the domain jonny521.development.local so that it has access to the same cookies.
Does anyone know how I can put my web application in the domain jonny521.development.local?
You can put an application on arbitary domain on your Iis. Just create a new website and in website properties, set the domain as the host name.
The remaining part is resolving the host name by your os so that when you navigate, you get to correct server. You can use a dns server but you can also modify the local host file (system32/drivers/etc/hosts).

ASP.NET webapplication deployment - with domain / server name access

I have deployed my ASP.NET web application on IIS (windows 2008 server). I have created a virtual directory (named TestApp) and all the users on local area network are accessing it with the following URL.
http://"SERVERNAME"/TestApp/Default.aspx
My client wants that, it should be accessed as following URL
http://"SERVERNAME"/Default.aspx
There is single application deployed on the server.
Could you let me know how can i implement this thing??
Instead of adding a virtual directory on the existing site, you need to add a new web site
Create a Web Site (IIS 7)
In fact, it's fairly simple.
Remove your current app, including all files and settings in IIS (i.e.: delete everything).
Run the deploy wizard again, BUT be carefull of the path that it's given to your application: by default, you should see "http://SERVERNAME/TestApp/". Remove "TestApp". The wizard will show you a warning message, just continue.
Finish the wizard as usual, and voila!
I did this 2 or 3 times yet.

Same .NET code files, different web sites/domains in IIS?

ASP.NET - IIS 6 - we currently have a public-facing site that has a domain mapped against it. We are going to add a new web site in IIS 6, with its own IP, its own SSL cert, and its own domain name on the same server as the original web site/domain.
Let's say I want c:\inetpub\wwwroot\example to be be served up to the two different sites, where each of the following URLs would load the same .NET code.
https://www.domainA.com/example
https://www.domainB.com
...I'm trying to not splinter my code, but I'm not sure if there are pitfalls with the above approach. Will that work?
Yes. I have had two separate sites / virtual directories pointing to the same physical directory on the server with one set of code.

Resources