A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
From:https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45Step by step instructions Prerequisites:
· IIS is installed on Windows Server 2012. To learn more about installing IIS 8, see Installing IIS 8 on Windows Server 2012.SETTING up IIS 8.0 with support for ASP. 3.5 and ASP. 4.5
In Windows Server, both the. NET Framework 3.5 and. NET Framework 4.5 is natively recognized by the operating system . This means both ui-based and command-line driven setup can is used to turn on both versions of the. NET Framework, as well As enabling integration of both versions of ASP. With IIS 8.0.
For this walkthrough we'll use the new server Manager UI in Windows server with server to demonstrate enabling both ASP. NET 3.5 and ASP. 4.5 on IIS 8.0.
1. When you first login to a new Windows server, the new Server Manager UI would display. Click Add roles as shown below:
2. On the first screen of Add Roles and Features Wizard, click Next. This display a page where you select the desired installation type. Choose either role-based or feature-based installation as shown below:
3. Click Next. The next screen of the wizard asks your to choose the server is configuring.
4. On the next wizard, step you'll be asked to select one or more server roles. Scroll the Roles list, and make sure to check the Web Server (IIS) checkbox as shown below:
5. Click Next to proceed to the next step, which enables-select additional specific features to install on The server. Click Next again and proceed to the next step.
6. The next wizard step displays some introductory information about the Web Server (IIS) role. Click Next again and proceed to the next step. Now you should is at a wizard step this looks like the following:
7. Note that a number of the default sub-features for IIS has already been turned on because you selected the Web Server (IIS) Server role earlier. However we want to enable both ASP-3.5 and ASP. 4.5 To run on IIS 8.0, so we need to enable some additional IIS rel Ated features. Scroll the Role services list until the application development node is showing. This node was collapsed initially, click on the node and expand it's children is showing:
8. The application development node is where we enable ASP. Integration with IIS. Note that there is a few checkboxes in the feature list with similar names. The pair of checkboxes that is of interest for this walkthrough is:
· ASP. NET 3. 5-this option enables ASP. 3.5 to run on IIS 8.0. Note that with Windows Server, the. NET Framework 3.5 are not available as a part of the base OS image. Instead, the payload is downloaded from the Internet and you need to connect to the Internet.
· ASP. 4.5 -this option enables ASP. 4.5 to run on IIS 8.0.
9. First click the ASP. 3.5 check box. When a additional dialog box would popup as shown below:
Since ASP. 3.5 is integrated to the Windows Server Setup, Windows Server, knows all of the related Depen Dencies necessary to enable ASP. 3.5 on IIS 8.0. This popup, dialog is just showing, you'll be a automatically pulled in and installed. Since we do want ASP. 3.5 enabled, click Add Required Features.
Next, click the ASP. 4.5 check box in the Role Services Feature List. The end result of clicking both ASP. Related checkboxes is shown below:
Even though you directly selected the ASP . 3.5 and ASP . 4.5, the wizard features Cally turned on a number of other items. This was done automatically so, developers do not has to explicitly choose the various component pieces needed to "the embly "of ASP. Windows Server 2012. At the-click Next to accept the changes.
The Confirm installation selections Step displays a list of all of the features that is installed if you accept The changes.
Click Install to accept the changes and install full ASP. On Windows Serve R 2012.
Since the installation would take a small amount of time-to-complete, the wizard displays a progress dialog while the I Nstallation progresses:
After a few minutes the wizard shows, the installation has completed:
At this point, you can click Close and exit the wizard.Exploring the IIS 8.0 installation
With both IIS 8.0 and ASP. Integration installed we can take a look at the basic ASP. NET footprint for IIS 8.0.
1. From the Windows Start menu select all Programs and then expand the administrative Tools menu. In the resulting list, find Internet information Services (IIS) Manager and select it to launch the graphical IIS Management tool:
2. Once The IIS Manager starts up, expand the server node in the left-hand window so that both the application pools node and Sites node is showing. When you do this the IIS Manager would popup a dialog asking if you want to stay connected with the latest Web Platform Com Ponents. For the walkthrough, you can click No. However on Real-world installations you'll probably want to click Yes so this Web Platform Installer is AVA Ilable for your use to download various IIS extensions such as the URL Rewrite Module. At this point, the IIS Manager looks like the following picture:
3. Click the Application pools node to display the application pools that has now been installed for use by IIS 8.0:
4. Can see that six different application pools is created by default when both ASP. 3.5 and ASP. 4.5 is Enabl Ed for IIS 8.0. Four of the applications is new for IIS 8.0, while the other application pools has been carried forward from previous Wi Ndows releases.
· Note that although the . NET Framework Version column shows "v2.0" and "v4.0" for. NET Framework versions, these E Quate to ASP. 3.5 and ASP. 4.5. Due to the internals of what application pools bind to. NET Framework versions, the actual version name written to Configur ation (and thus displayed in the tool) corresponds to the original. NET Framework file version.
· Classic. NET apppool and DefaultAppPool existed in previous versions of Windows, and thus continue to be Created for IIS 8.0. Note however this since. NET 4.5 is the default. NET Framework for use by Windows Server, the ' DefaultAppPool ' on IIS 8.0 also defaults to using the newer version of the. NET Framework.
· The other four application pools is new in Windows Server 2012. There is application pools for running. NET Framework 3.5 (. NET v2.0 and . NET v2.0 Classic), and TW o Application pools for running. NET Framework 4.5 (. NET 4.5 and . NET 4.5 Classic).
· The difference between "classic" and "not classic" application pools are the managed pipeline mode supported in each applic ation pool type. The application pools ending in "classic" and the older Windows Server 2003-era Classic pipeline mode for ASP. While the other, pools use the newer integrated pipeline mode for ASP. Application introduced in vista/iis7.0.
5. Exploring a little bit further, expand the Sites node in the left-hand side of the Ult Web Site node is visible:
6. Default installations of IIS always has a "Default Web Site" configured to listen for HTTP requests on port 80. Drill into the ' default Web Site ' to see what version of ASP. NET it supports by Default. Right-click Default Web Site, then selectManage Website, and select Advanced Settings as shown Below
7. The Advanced Settings dialog pops up, showing (amongst other things) the application pool used to run the "Def Ault Web Site ". As shown in the picture below, the "Default Web Site" runs in the application pool called "DefaultAppPool":
8. If you click the small ellipsis-button on the right-hand side of the application pool, a additional dialog pops up di splaying more information about the "DefaultAppPool". As noted earlier the "DefaultAppPool" defaults to ASP. 4.5 for IIS 8.0, so ASP. 4.5 Applications in the "De Fault Web Site "would work without any further configuration.
9. At this point, click Cancel to cancel both the Select application Pool dialog, and the A dvanced Settings dialog.RUNNING BOTH ASP. 3.5 and ASP. 4.5 Applications
Now so you had explored the setup state of IIS 8.0, try running some sample ASP. NET code to confirm that both ASP. 3 .5 and ASP. 4.5 applications can run simultaneously on a single IIS 8.0 installation.
Sample code for both ASP. 3.5 and ASP. 4.5 is contained in the following. zip:
First, set up a simple ASP. 3.5 Application on IIS 8.0:
1. Open the "examples.zip" file.
2. In Windows Explorer on your Windows Server-navigate, the "wwwroot" directory for your IIS installation. For example if your installed IIS on the "C: \" Drive, the "wwwroot" directory would be at "C:\inetpub\wwwroot".
3. Copy the folder "Example35" from "Examples.zip", and paste it into the directory "C:\inetpub\wwwroot". When you do the directory structure should look like the following:
4. The newly created "example35" folder needs to is configured as an ASP. 3.5 in the IIS Manager. Go back to the IIS Manager window, click on the Default Web Site node, and select Refresh. The TreeView of child nodes under theDefault Web Site now shows the "Example35" folder:
5. Right-click the example35 folder and select Convert to Application:
6. The ADD Application dialog'll pops up. By default all directories within default Web Site is part of the application pool called Defaultapppool. This means, newly created folders containing ASP. NET run as ASP. 4.5 By default.
7. Since we want to run the example35 folder as an ASP. 3.5 application, the application pool needs to be Chan Ged. Click Select, and the Select Application Pool dialog that pops up. The application pool to . NET v2.0 as shown below:
8. Click OK button to accept the application pool change, and then click OK again to commit the changes To IIS. The IIS Manager window appears again. In the TreeView showing ' Default Web Site ', the icon for ' example35 ' is changed to indicate it's now a separate ASP Pplication.
9. At the "start an" instance of Internet Explorer and navigate to the following Url:
After a short pause the application displays a list of. NET Framework features supported in this application.
For Windows Explorer, if you navigate to the ' c:\inetpub\wwwroot\example35 ' directory, you can use Notepad-to-look at t He code for "default.aspx" and the information in "Web. config". For example, the contents of Web. config include directives that configure the. NET Framework compilers to run in "3.5" MoD E. The. NET Framework code in "default.aspx" demonstrates some C # constructs that were introduced in. NET 3.5-specifical Ly Linq-to-object queries.
Now that there was an ASP. 3.5 application running, you can create a second ASP. Application, but this time configure it to use. NET 4.5.
1. Go back to the Windows Explorer window, which has the. zip file "Examples.zip" open.
2. Open up the contents of the "Example45" folder.
3. In the second Windows Explorer window, there is open, navigate to "C:\inetpub\wwwroot".
4. Copy the "default.aspx" file from the. zip file and paste it directly into "C:\inetpub\wwwroot". The folder contents for ' C:\inetpub\wwwroot ' should now:
5. Now go, Internet Explorer and navigate to the following Url:
After a short pause a second application pool would start running an ASP. 4.5 Application for the "Default Web Site". The browser once again displays a list of. NET Framework features supported in this application with a new entry at the E nd of the list for dynamically typed variables (i.e. the Dynamic keyword introduced in. NET 4.0/4.5). Notice that unlike the "example35" application that required special Web. config entries, no web. config file was required T o Configure and run the "Default.aspx" page in the "Default Web Site". This is because. NET Framework 4.5 are the default. NET Framework used by ASP. Applications in IIS 8.0, and as a result No extra configuration is required.
6. If you use Notepad to open the "default.aspx" page so just copied, you'll also see a few changes compared to th E version in the "Example35" directory. There was no namespace directives at the top of the page since the. NET Framework 4.5 was the default on IIS 8.0. The code on the page demonstrates using a dynamic variable, which are a compiler concept introduced in. NET 4.0/4. 5.
IIS 8.0 Using ASP. 3.5 and ASP. 4.5 Microsoft Official Installation Guide
Start building with 50+ products and up to 12 months usage for Elastic Compute Service