02 December 2009

wspbuilder error "Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, PublicKeyToken=85376ef9a48d191a' or one of its dependencies. An attempt was made to load a program with an incorrect format."

I really love when a fix is simple.

Back story: in this case, I am in the midst of using a combination of wspbuilder and spsource to reverse engineer, package up and deploy a few custom content types. wspbuilder is a codeplex Visual Studio extension that helps package up SharePoint code into a Solution file (WSP) for deployment. spsource is another tool that tries to analyse a SharePoint site and tease out a schema.xml for a list, and column & field information for a content type.  I use the term 'tries' because depending on how clean your dev environment is, your mileage may vary. 

Problem description: when running WSPBuilder -> Build WSP, the output window in Visual Studio says

Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, PublicKeyToken=85376ef9a48d191a' or one of its dependencies. An attempt was made to load a program with an incorrect format.

It is my belief this problem is related to the installer not detecting/switching to the correct version of this DLL - there is an x86 version and an x64 version.

Fix:
[applicable to the wspbuilder.exe version 0.9.8.1029 file date apr 15 2009, 262kb] :
copy the x86 cablib.dll
from

C:\Program Files\WSPTools\WSPBuilderExtensions\Resources\x86
to:
C:\Program Files\WSPTools\WSPBuilderExtensions\

(if you can read espanol, it is in this blog: http://guatecommunity.net/blogs/jmhogua/archive/2009/05/13/wspbuilder-could-not-load-file-or-assembly-cablib.aspx )
another option is to download the latest version (> v1.0.5) of wspbuilder, which states in the release notes "Note! 22 June 2009 - x64 CabLib.dll install bug fixed."
 
Hooray for multiple fixes!

No comments:

Post a Comment

firstly, thanks in advance for your comment - I don't get very many, so I'm sure to follow up if you leave me a way - secondly, come again.