Debug Deployment Issues
Multiple versions of the .NET Framework can run on a single computer at the same time. This means that you are able to specify which version of the Common Runtime Language you’d like to use on an application level. The tool that helps you in this is called aspnet_regiis.exe.
When you install a more recent version of the .NET Framework on a computer, all of the ASP.NET applications installed will be configured to use the newer version, by default. You can then use the above mentioned aspnet_regiis.exe for changing this behavior.
When multiple versions are installed in your computer, each version has its own ASP.NET ISAPI extension (Aspnet_isapi.dll). With the aspnet_regiis.exe tool, you are able to define which version of the DLL you’d like to use on an application level, in IIS. The IIS Registration tool then sets your application’s script map to the appropriate DLL.
A script map is built from three elements: a file extension, an HTTP verb, and the version of the ASP.NET ISAPI extension, with which they’ll be associated. You can set the script mappings in an application (or application-pool) level basis, in IIS.
Installing Multiple Versions
Versioning conflicts may occur if the two versions of the Framework are incompatible. Although the .NET Framework is built to be backward compatible, there may be some issues. As I mentioned above, when you upgrade the version of the .NET Framework, all ASP.NET applications will be reconfigured to use the new one. You may want to override this behavior. If you’d like, you can run the installer of the Framework with the /noaspupgrade switch, which does literally what its name is, not upgrading the installed ASP.NET applications.
Let’s see the referred aspnet_regiis.exe. It lives in the folder of the .NET Framework (each version has its own). Depending on which version you open, the switches specified will have different meanings.
|-i||Installs the current version of the .NET Framework, and associates all your websites to use it.|
|-ir||Installs the version of the .NET Framework, without associating your web sites.|
|-c||Installs the client-side scripts to every web application’s aspnet_client subdirectory. Only the scripts associated with the current version will be installed.|
|-e||Removes all client-side scripts from every web application’s aspnet_client subdirectory. Only the scripts associated with the current version will be uninstalled.|
|-ea||Removes all client-side scripts from every web application’s aspnet_client subdirectory.|
|-disable||Disables ASP.NET in IIS.|
|-enable||Enables ASP.NET in IIS. When working with Windows Vista, you should use the Windows Services application instead of this command.|
|-lv||Lists all installed .NET Framework versions. Requires administrative rights.|
|-u||Uninstalls the current version of ASP.NET from IIS, all the mappings will be updated to the remaining versions.|
|-ua||Uninstalls all versions of ASP.NET.|
|-s path||Installs the current script mapping at the specified path, to all applications.|
|-sn path||Installs the current script mapping at the specified path. Subdirectories not included.|
You can also use the aspnet_regiis tool to encrypt/decrypt the contents of your web.config file, using the –pe/-pd and the –pef/-pdf switches. F in the switch means that you specifying an absolute file path location, not a virtual directory. Example syntax:
-aspnet_regiis –pef connectionStrings C:\MyAppDirectory
Encrypts the connection strings of the root web.config file in the MyAppDirectory, to decrypt:
-aspnet_regiis –pdf connectionString C:\MyAppDirectory