Resolving Version Mismatches & Library Errors
If your website displays errors such as "Library not found," "Could not load file or assembly," or configuration errors regarding "targetFramework," it is highly likely that your website is assigned to the wrong ASP.NET version.
By default, new websites are assigned to the latest stable .NET Framework (4.0 - 4.8). If you are deploying an older application (or a .NET Core application requiring specific handling), you may need to adjust the IIS Application Pool settings.
Step-by-Step Solution
- Navigate to Your Website
- Log in to the control panel.
- Navigate to the Websites section.
- Click on the specific website displaying the error.
- Edit Application Pool Settings
- On the website dashboard, locate the IIS Application pool card (typically found at the bottom right of the screen).
- Click the EDIT button within that card.
- Select the Correct Version
A dialog box will appear. Adjust the following settings to match your application's requirements:
- ASP.Net version:
- Select
.NET Framework 4.0 - 4.8 for most modern applications (including MVC and Web Forms).
- Select
.NET Framework 2.0, 3.0, 3.5 only if you are running a legacy application.
- Managed Pipeline Mode:
- Integrated: The standard for modern IIS versions.
- Classic: Use this only if your application specifically relies on the older IIS 6.0 processing model.
- Apply Changes
- Click the UPDATE button.
- Your application pool will recycle automatically, and the new settings will take effect immediately. Refresh your website to check if the error is resolved.