How to route request from one application pool to another in iis 6.0 - asp.net

I have got two web applications (separate virtual directories) residing in the DefaultAppPool on Windows Server 2003. My first application has got a link and when I click on it, the second application opens up.
Now I want to use different .Net framework for both web applications and for that in IIS 6.0, I will have to host them in separate app pools.
Now the question is - is it possible to host them in different app pools and keep the behavior intact so that if I click on the link in first web application, it can still open the second web application hosted in a different app pool?
Thanks in advance,
D

I think I've found the solution and it is simpler than what I actually thought.
Steps I took:
Create another app pool in IIS 6.0 on Windows Server 2003
Assign one of the web applications to this pool. So now I have two web applications in two different app pools. Currently both are having ASP.NET version as 2.0.50727
Change the ASP.NET version of one of the applications to 4.0.30319. So interesting fact to understand here is - in IIS 6, you can't set the .NET framework for an app pool. It actually assumes it from the first application in it and then applies it to all the web applications residing in this app pool
And it is done!!
It can be checked to list all the sites and which .NET versions they are configured to by using aspnet_iisreg -lk. Run this command from your .NET framework directory. For ex: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
Both the sites with different .NET framework will be listed
Hope this helps.

Related

Can't upload two different framework websites on a server

I am trying to upload two different framework(2.0 and 4.0) websites on a server.
If iis target framework 4.0 is enabled then my website 2.0 shows the error: Server Application Unavailable
If iis target framework 2.0 is enabled then my website 4.0 shows an error
Unrecognized attribute target Framework.
Note that attribute names are case-sensitive.
An IIS application can only run under one framework. Each application however is assigned to an application pool which determines what version of the framework to run.
You can simply create a new application pool that works with a different version of the framework.
See the MS Technet article on details for how to do this.
From the article for IIS7:
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the server node and click Application Pools.
On the Application Pools page, in the Actions pane, click Add Application Pool.
On the Add Application Pool dialog box, type a friendly name for the application pool in the Name box.
From the .NET Framework version list, select the version of the .NET Framework required by your managed applications, modules, and handlers. Or select No Managed Code if the applications that you run in this application pool do not require the .NET Framework.
From the Managed pipeline mode list, select one of the following options:
Integrated, if you want to use the integrated IIS and ASP.NET request- processing pipeline.
Classic, if you want to use IIS and ASP.NET request-processing modes separately. In classic mode, managed code is processed by using Aspnet_isapi.dll instead of the IIS 7 integrated pipeline.
Select Start application pool immediately to start the application pool whenever the WWW service is started. By default, this is selected.
Click OK.
Edit1
The problem can be Framework. As it is case sensitive
You can set the framework as follows
<compilation debug="true" targetFramework="4.0">
Old
You need to create different application pool.
One application pool should be using framework 2.0
and another should be using framework 4.0
Apply in both the application accordingly.
Here is a good link
http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
MSDN Article link

Starting .Net web service on the same port as the ASP.Net application

We have a simple Visual Studio solution containing 2 projects:
A.) Simple ASP.Net website
B.) RESTful web service hosted in another ASP.Net application
We want to simply start the projects in Debug mode (F5) and have A consume data from B through Ajax. We do not have the possibility to configure IIS on all development machines (because some of them are on the client's side). The problem might be that JavaScript needs to be in the same domain as the URL it posts to.
Is there any way we can use Visual Studio 2010 Development Server to start both applications simultaneously in debug mode on the same port?
If this is not possible, what is the next best thing you can recommend?
We solved this problem by installing IIS on the development workstation.
In each Visual Studio project, on the Web property page, select Use Local IIS Web server.
Do not check Use IIS Express. The Project URLs will be set to http:localhost/<projectname> (note: in the same domain). You’ll be prompted to Create a Virtual Directory for each. Each will be assigned to the default IIS app pool. Open the Internet Information Services (IIS) Manager. Click Application Pools on the left pane. On the right pane add another integrated application pool. For one of the applications, open the Advanced Settings... In the properties view select the app pool you just created as the application pool. The applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.
Yo won't be able to host different apps on the same port within a Cassini instance, there are tools that might be useful but I would leave Cassini host them on different ports which is its regular behavior.
Options are (not tested):
UltiDev
Cassini Extesion
By the way, not sure if you know this, but to start both projects go to Set startup projects, there's an option on the Solution context menu.

Run Many ApplicationPools in one WebApplication on IIS 7+

It's possible to run more that one aplication pool in the same WebApplication on IIS 7 or 7.5? I have one web application on asp.net 4.0 that use EF 4.0 and a large set of Entities. Then the First query Its to slow and when the application pool fails, the users need to login again, but the pool was restarted and the first query Its too slow, this cause any can't login for a time (about the time that the old pool is finished and the new pool It's ready).
If I can use multiple applications pools for the same site, on the same port 8080 for example, thats solve my problem. The only way I found was to create a server farm. However, if I understand, each servers would be a virtual or real machine?
You can have multiple applications and associated pools running under one site directory root. In IIS 7 manager, simply right-click on the folder in question and select "Create Application" in the resulting dialog set the new application pool and the physical path. This will mean that you have to segregate your code into separate projects/modules (web applications or web application projects in vs) but they will all share the same site.

Install ASP.NET 4.0 alongside ASP.NET 2.0 on IIS6

I've read where you create a new application pool, one for 2.0 sites and one for 4.0 sites. But there is no option I see when creating a pool to configure the framework.
My problem is I have several 2.0 sites running as the Default Web Site. I added a WCF 4.0 service under a new virtual directory and set the framework to 4.0. I also put it in a separate app pool.
Now, I can only get one working at a time. Either the 2.0 sites or the 4.0 site. I get:
It is not possible to run two
different versions of ASP.NET in the
same IIS process. Please use the IIS
Administration Tool to reconfigure
your server to run the application in
a separate process.
Is it possible to do this under IIS6 and Windows Server 2003?
To clarify: Each app pool binds to the .NET framework of the first web site that uses it, in order of application startup. That first site will run fine, but all other sites will be restricted to the same app pool. You need at least one app pool per framework version; and in my experience, the most robust setup is one app pool per application - this way, you can switch framework versions without worrying about other applications, and you can kill individual applications through task manager when the need arises.
The App Pools don't need configuring, just make sure the 2.0 sites are running as one, and the 4.0 site running as another.

IIS6 | Application Pools | ASP.NET Framework

In IIS6 it's possible to have more than one ASP.NET application running in the same application pool. This is fine, except that there is nothing in IIS6 that prevents you from running multiple .NET versions in the same pool.
When you create application pools in IIS7 you must explicitly state was .NET version will be running in that pool. Running multiple .NET versions in IIS7, in the same application, is impossible.
How can I enforce such rules on my IIS6 server in order to prevent my deployment team from creating such problems?
What I do:
Step 1. Create the following application pools:
.NET 1.1 Apps
.NET 2.0 Apps
Step 2. Disable the "Default App Pool"
Now, any time a new application is configured in IIS, it will not work right away because the default app pool is disabled. This forces the person configuring the application to select an app pool that is appropriate for the .NET framework version of the app.
We tend to use one application pool per site, so that each application is isolated in its own process space. Application pool recycles will only affect a single application, and each worker process ends up with its own 4gb memory space. Badly programmed applications have no chance of affecting other applications, resulting in a highly isolated deployment model.
We've also standardized on x64 OS builds running 32bit application pools. While there is overhead using this technique since each application ppol contains a separate copy of the .Net framework, we feel that the added granularity of the application space adds stability to our deployments. You also get the ability to run each application as it's own domain identity, allowing for further memory space isolation and eliminating any need for identity impersonate in web configs.
With IIS 7, you have the ability to run each application pool as either 32 bit or 64 bit, so you can run large memory applications in 64 bit application pools. IIS 7 application pool security is also much more simplified.
I don't think you can. What I do is name my app pools in IIS 6 so that they show what .Net version they host. That way it's easy to pick the correct app pool when creating a new application.
If I remember correctly, you can also setup application pools in IIS6 (Windows 2003). Create one application pool per framework version in use.
I am not aware of any possibility to enforce the version of the .NET framework being used by an application. If you have setup an application pool to use .NET 1.1 and you have a .NET 2.0 application running in that application pool, you will get an exception in the application (yellow screen of death), since it will not find some referenced assemblies and classes.

Resources