Wednesday, August 12, 2009

Sharepoint Assembly Platform

I recently started a project which consisted of a set of assemblies deployed to the GAC. While integrating with a larger application, the assemblies build configuration were modified to build on x86 Platform (32-bit) explicitly. This was done believing that if they were built as 32-bit, both 32-bit and 64-bit applications could use them.

This worked fine in a 32-bit environment. However, when deploying to a 64-bit environment I was getting "file not found" errors. After some looking into the C:\windows\assembly\gac_msil directory on the server I noticed there where multiple directories there:

  • gac_msil
  • gac32
  • gac64


After some research I discovered that on a 64-bit server, assemblies built as:

Any CPU: go into the gac_msil directory and can be used by either 32-bit or 64-bit processes.

x86: go into the gac32 directory and can only seen and used by 32-bit processes.

x64: go into the gac64 directory and can only be seen and used by 64-bit processes.

My conclusion: leave the build configuration as "Any CPU" !!!!

No comments: