Friday, August 06, 2010

Running ILM Rules Extensions in FIM 2010

The FIM team did some work to make ILM to FIM upgrades easy.  You can actually copy your ILM rules extension DLLs from an ILM box running Windows x86 to a FIM box running Window x64 and run the same DLL without recompiling.

This works really well for both Rules Extensions, and my favourite, ECMA Extensions.

I found a slight twist on this lately where the error message was less then helpful.

A C# Project referenced by a Rules Extension project was configured with a Platform Target of x64.  In Visual Studio the project options for Target Platform are:

  • x86
  • x64
  • Any CPU (the default)

Anyhow, when ILM tried to load the rules extension it failed with

System.IO.FileNotFoundException: Could not load file or assembly 'HoofHearted, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Turning on Fusion logging revealed that it was looking for a file that clearly existed!  The file DID exist, but it was compiled with the wrong target so ILM could not load it.  While FIM would have loaded it just fine, ILM is still only to load x86 assemblies (which is quite fair).

So the moral of the story is: leave the ‘Target Platform’ as the default (Any CPU) unless you have a good reason to do otherwise.  And if you do specify x64 then keep in mind that you cannot move that DLL back to ILM without re-compiling.

BTW – this has very interesting ramifications for teams that ship ILM DLLs but don’t officially support FIM, but you didn’t hear it hear ;-)

No comments: