You may face the below error while running on your ASP website which targeting to the application pool with ASP.NET 2.0 and in this case you will need to change the application pool to use ASP.NET 4.0. Also, make sure your ASP.NET 4.0 is registered with IIS.
Steps to Change Application Pool of a Website from IIS:
- Login to your VPS.
- Open Start > Administrative tools > IIS Manager.
- Expand the “Sites” folder from left-side panel.
- Select the particular website which is facing 'targetFramework' error.
- Right click on the Website and select Manage Web Site > Advanced Settings, as shown in following image:
- Change the ‘Application pool’ to ASP.NET 4.0 as below.
- Click on OK command button.
Another Way to Change Application Pool is as below:
- Open Start > Administrative tools > IIS Manager.
- Click on Application Pools and select the dedicated application pool (Only if website is having dedicated application pool) as shown in following image:
- Set the version of ASP.NET to 4.0, as shown in following image:
- Click on OK command button.
Note: If you are having a control panel then we recommend you to change the application pool from there.