Thursday, September 07, 2006

Dealing with .NET 2.0

OK, so this is a little bit off my mainstream topics of CAD-specific application development... But I'm hoping that it's useful either to the CAD people or .NET developers in general...

As you may know, in the CAD world, we're (finally) being driven to .NET 2.0 (at least in the Autodesk world - I get the sense that the PTC/Dassault/UGS worlds, which are still multi-platform, are not pushing it as aggressively)...
For example:

  • AutoCAD 2007 - DotNet 2.0 mandatory
  • Revit 9.0 and 9.1 - DotNet 2.0 mandatory

But I ran into a problem with two of our clients in the same week, with the same issue in different applications. In both cases, they were deploying our applications onto new machines. And when they tried to run the applications, in both cases they got:

System.TypeLoadException: Could not load type`system.runtime.compilerservice.runtimecompatibilityattribute`from assembly`mscorlib, Version=2.0.0.0, Culture=neutral, publickeytoken=b77a5c561934e089`"

(or something close to that)...

What was the issue? In both cases, the machines had .NET 2.0, but they had the BETA version of DotNet 2.0 installed (build 2.0.50215). But the behavior was strange - some of the code executed, but other parts didn't... In any case, the TypeLoadException should be a red flag for developers.

How is it that these people had beta versions of .NET running around? Who knows... Obviously some early-adopter-developer sent them something that required it, and now we have to deal with the aftermath!

This is a complicated issue - I'm pretty sure that AutoCAD 2007 installs 2.0 as a pre-requisite. However, the Revit products do not (and our other product was a self-contained Vault application)...

So - to paraphrase Esterhaus on the police drama Hill Street Blues, "Let's be careful out there".

(Check during install for the existence of C:\Windows\Microsoft.NET\Framework\v2.0.50215, perhaps?).

No comments: