As a .NET shop (primarily), we need to stay on top of Microsoft’s software releases, especially when a new version of .NET comes out.  .NET 4 was released on Monday and so we’ve been putting some effort into trying our software on the new platform in order to eliminate any future surprises.

As expected, there were a bunch of little things that cropped up but nothing too major.  Among the issues there was one in particular that was a bit interesting.

When I launched our Geocortex Essentials Web ADF Elements viewer (after setting the target platform it to .NET 4.0) everything seemed to work fine except for one small detail: no map.

EssentialsNoMap

After a bit of investigation, I discovered that problem was that the ASP.NET framework wasn’t able to locate the MapHandler supplied by ESRI as part of their Web ADF platform:

[HttpException]: The file '/Geocortex/Essentials/Web/ESRI.ArcGIS.ADF.Web.UI.WebControls.MapHandler.ashx' does not exist.

Then a colleague reminded me that ESRI registers this handler within the machine’s web.config file (in my case, located in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config).  Well, this won’t do since the global web.config file that my viewer is now targeting is located at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\web.config.

Moving the handler references from the machine web.config in the .NET 2.0 directory into the viewer application’s web.config file solved the problem.  Now I’m convinced this is where those handler references belong.

If you’re customizing Geocortex Essentials Web ADF Elements, or ESRI’s .NET Web ADF and you want to start using .NET 4.0, I hope this helps.

Incidentally, we’re not planning on releasing a version of Geocortex Essentials which targets .NET 4.0 until version 3.0 (which will be in Beta early this summer).  At 3.0, our REST Elements and Web ADF Elements within Geocortex Essentials will both make use of some of the new technology .NET 4.0 offers.