Friday, October 8, 2010

CabLib – Error running MakeCab.exe

CabLib – Error running MakeCab.exe
Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, Publ
icKeyToken=85376ef9a48d191a' or one of its dependencies
I was trying to create a solution package for SharePoint. Thus, planned to use the Makecab.exe to create the cab file. Upss!! got this error while running the makecab.exe /f MyAppPackage.ddf
Building the solution - please wait
Saving the Manifest.xml file
Creating the WSP file
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 seemed that the Dll could not be loaded
Sometimes this could happen while running wspbuilder.exe also.
Investigation:
1. I have the CabLib.dll file in the same directory as wspbuilder.exe
2. cabinet.dll exists in the windows\system32 directory.
3. The CABLIB.DLL is a C++ library and therefore you have to use the right version of it when you are using 32 or 64 bit windows server systems.
Solution :
Thought of one very simple solution, normally whenever I get stuck with such problem I use that only…. Putting the dll in the GAC haaaaaa. Found the dll from this location.
C:\Program Files\WSPTools\WSPBuilderExtensions\Resources\x86]
CabLib.dll
Dropped in Assembly file….. i.e. GAC. And it worked…. That’s all….
HaPpY CoDiNg………….
Partha (Aurum)

No comments:

Post a Comment