Getting Event Handlers developed in VS.NET 2005 to work with SharePoint V2

Note: Just don’t bother to read further if you have a SharePoint server running on IIS that has ASP.NET 2.0 installed on it already.

Ok, so you have your SharePoint server running on IIS that has ASP.NET 1.1.xxxx installed on it and you have developed a cutting-edge event handler in .NET 2.0 and it wouldn’t work when you register the dll in the SharePoint site! Unfortunately, there isn’t a way to make the event handlers developed using .NET 2.0 work in the above said configuration, so you need to upgrade to ASP.NET 2.0.

Note: Once you’ve upgraded to .NET 2.0, switching back to ASP.NET 1.1.xxxx might cause some real weird issues.

Follow the below steps to upgrade your IIS and your SharePoint site to use ASP.NET 2.0.xxxxx

1. After running the .NET Framework 2.0 installer, open command prompt and type in the following commands to install ASP.NET 2.0.xxxxx onto the IIS and its virtual servers:

a. C:\>cd %SystemRoot%\Microsoft.NET\Framework\v2.0.50727 [hit enter]

b. C:\WINNT\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis –i –enable [hit enter]

2. Now you’ve installed ASP.NET 2.0 on IIS. Open up “inetmgr” and edit the properties of the virtual server you want to use ASP.NET 2.0 on. Ensure ASP.NET tab has 2.0.xxxxx version selected. Do an iisreset.

3. Then you need to upgrade the SharePoint site to use ASP.NET 2.0.xxxxx as well. To do that, open command prompt and do the following:

a. C:\>cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN [hit enter]

b. C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN>stsadm.exe –o upgrade –forceupgrade –url https://sharepointservername [hit enter]

4. That’ll upgrade your SharePoint server to use ASP.NET 2.0.xxxxx. Do an iisreset.

Now, you should be able to register the event handler dll developed using Visual Studio 2005 without any issues.