WSPBuilder doesn't create .wsp file

May 30, 2008 at 8:56 PM
I'm new to Sharepoint development.  I have VisualStudio 2008 and have installed the SharePoint_SmartTemplates_for_Visual_Studio_2008_v0.2.exe and created a new project selecting the "SharePoint Web Part (SmartTemplate)" option.  That creates a "hello world" kind of WebPart.

So without making any changes, I have VS build the project and I get a error in the createwsp.bat file - "exited with code 4."

The build output looks like this:
------ Build started: Project: TestWebPart, Configuration: Debug Any CPU ------
TestWebPart -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\TestWebPart\TestWebPart\bin\Debug\TestWebPart.dll
CD C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\TestWebPart\TestWebPart\\WSP
Copying DLL ...
1 File(s) copied
Running WSPBuilder ...
Copying WSP to Setup ...
File not found - TestWebPart.wsp
0 File(s) copied
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3314,13): error MSB3073: The command "CD C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\TestWebPart\TestWebPart\\WSP
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3314,13): error MSB3073: createwsp.bat
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3314,13): error MSB3073:     " exited with code 4.
Done building project "TestWebPart.csproj" -- FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Digging further, I find that the WSPBuilder utility is not creating the .WSP file so then the xcopy fails. 

I played around with the WSPBuilder utility command line options - adding "-TraceLevel Verbose" - but it doesn't emit any additional information.  WSPBuilder seems to run to completion with no errors but no WSP file is created.  The createwsp.bat file has this:

.\WSPBuilder\wspbuilder -wspname TestWebPart.wsp -BuildCas false -SolutionId da600163-65e5-43d0-a295-d98ee67f768d

Why isn't the .WSP file being created?

Jul 28, 2008 at 10:00 PM
I am encountering this very same problem.  I've new to SharePoint and am at a complete loss at this point.  I'm running SharePoint WSS 3.0 on a Windows Server 2003 64-bit machine using Visual Studio 2008.  Any help would be greatly appreciated.
Jul 28, 2008 at 11:04 PM
I figured out my problem.  Was trying to build on a x64 machine with the x86 version of CabLib.dll.  Worked like a charm once I downloaded the x64 version.
Oct 20, 2008 at 2:19 PM
I had the same problem. It just stopped working, but then I updated with the latest code and it works well again. I had the version included with SmartTemplates
Jan 14, 2009 at 10:42 AM
I was having a similar problem (x64 machine) when using SmartTemplates . I replaced the CabLib.dll in the Program Files directory (WSPTools/WSPBuilderExtensions) but this still did not stop the problem. After having a look at what the .bat files were doing I found that I had to replace CabLib.dll in the solution's directory. However I have now found that each time I create a template from SmartTemplates I need to replace the CabLib.dll that it places in the solution's directory. Just thought I'd make a mention of that here in case anyone else has the same problem