Reputation: 3892
The Environment:
Windows Server 2008 R2 Enterprise Edition IIS 7.5.7600.26385
The Problem: I have an existing web site currently running ASP.Net version 2.0 and want to move to ASP.Net 4.0. I do NOT have Visual Studio so I cannot simply use an “upgrade wizard” to perform this task. Here is what I have tried so far:
in IIS:
When logged into the server, I use the aspnet_regiis program to list and verify the versions of ASP.Net that are installed (I thought I would get the same answer from all directories, but below is what is reported):
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -lv
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
2.0.50727.0 C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
C:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis -lv
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
2.0.50727.0 C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -lv
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -lv
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
4.0.30319.0 c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Obviously, there are steps I am missing:
Does anyone have a step-by-step guide for upgrading from 2.0 to 4.0 WITHOUT Visual Studio? Or, does anyone have link to such a guide??
Thanks in advance!
Upvotes: 2
Views: 4391
Reputation: 3892
Ok -- FINALLY got things to work, below is the magic:
Check using appcmd.exe to list the isapiFilters that have been configured:
C:\Windows\System32\inetsrv>appcmd.exe list config -section:system.webServer/isapiFilters
<system.webServer>
<isapiFilters>
<filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64" />
<filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32" />
</isapiFilters>
</system.webServer>
The above shows that the version 4.0 filters are NOT present, so I issue the following:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -iru
Start installing ASP.NET (4.0.30319).
....Finished installing ASP.NET (4.0.30319).
Now verify that version 4.0 is present:
C:\Windows\System32\inetsrv>appcmd.exe list config -section:system.webServer/isapiFilters
<filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv2.0" />
<filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv2.0" />
<filter name="ASP.Net_2.0_for_V1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv1.1" />
<filter name="ASP.Net_4.0_64bit" path="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness64" />
<filter name="ASP.Net_4.0_32bit" path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness32" />
And now to update the site from version 2.0 to 4.0:
Create an application pool that uses version 4.0 – be sure to set “Enable 32-Bit Applications” option to true if need be.
Stop the web site being upgraded.
Right-click on the web site -> Manage Web Site… -> Advanced Settings
Change the “Application Pool” to the version 4.0 application pool created in step 1. Click OK -> OK
Click on the ‘.Net Compilation” option and verify that the “Assemblies” section is using version 4.0.
Recompile web site DLL’s using the 4.0 framework and deposit in /bin directory.
Delete all files/folders in the web temporary directory (for holding temp asp.net files), This must be done otherwise access denied errors will be displayed when the web site is started.
Right-click on the web site -> Manage Web Site -> Start
Test all pages.
The above worked for me.
Upvotes: 3