locked
Creating .WSP for SharePoint 2007 RRS feed

  • Question

  • How to create .WSP for SharePoint 2007

    Visual Stuido 2008 and SharePoint 2007
    I am working on an exisitng VS 2008 solution. I got pre-set up server for share point, I have no idea how the previous contractor created .WSP, they said, just run .bat file.

    here is the code for my CreateWSP.bat
    @ECHO OFF
    ECHO Copying DLL ...
    xcopy /y "..\bin\debug\test.dll" .\80\BIN
    xcopy /y "..\bin\debug\test.dll" .\GAC
    xcopy /y "..\bin\debug\test.pdb" .\80\BIN
    ECHO Running WSPBuilder ...
    .\WSPBuilder\wspbuilder -wspname test.wsp -BuildCas false -SolutionId 567g7err.....
    ECHO Copying WSP to Setup ...
    xcopy /y "..\WSP\test.wsp" ..\Setup
    Wednesday, September 19, 2012 6:13 PM

Answers

  • Hi SkyStar11,

    The mention of wspbuilder makes me suspect that the previous contractor simply used the WSPBuilder solution from CodePlex to create WSPs. http://wspbuilder.codeplex.com/

    This gives you some templates for WSPBuilder projects and gives you the "Build WSP" option in Visual Studio, but it does require that you set up folders in your project so that it mimics the SharePoint hive (i.e. C:\Program Files\Common Files\Microsoft Shared\Web Server Extension\12)


    • Proposed as answer by Steven Andrews Thursday, September 20, 2012 11:20 AM
    • Marked as answer by Steven Andrews Thursday, September 20, 2012 11:20 AM
    • Unmarked as answer by SkyStar11 Thursday, September 20, 2012 9:49 PM
    • Marked as answer by SkyStar11 Thursday, September 20, 2012 9:50 PM
    • Edited by thriggle Wednesday, September 26, 2012 7:04 PM
    Thursday, September 20, 2012 3:12 AM
  • Hi SkyStar,

    The "Could not resolve: Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c." message makes me wonder... are you running Visual Studio on a web server with SharePoint installed, or are you running it on a separate development machine?  You may need to build it on a machine where SharePoint is actually installed in order for the assembly references to resolve.

    Where are the Feature.xml and contact.Webpart files that you mentioned?  wspbuilder expects them to be buried in an appropriate FEATURES folder like so:

    You should also check the properties of the files and items you want WSP builder to include.  Pay particular attention to the Build Action property.  If it is set to None, I don't believe it will be included in the output.



    • Edited by thriggle Thursday, September 20, 2012 5:27 PM
    • Marked as answer by SkyStar11 Thursday, September 20, 2012 9:58 PM
    Thursday, September 20, 2012 5:26 PM

All replies

  • Hi SkyStar11,

    The mention of wspbuilder makes me suspect that the previous contractor simply used the WSPBuilder solution from CodePlex to create WSPs. http://wspbuilder.codeplex.com/

    This gives you some templates for WSPBuilder projects and gives you the "Build WSP" option in Visual Studio, but it does require that you set up folders in your project so that it mimics the SharePoint hive (i.e. C:\Program Files\Common Files\Microsoft Shared\Web Server Extension\12)


    • Proposed as answer by Steven Andrews Thursday, September 20, 2012 11:20 AM
    • Marked as answer by Steven Andrews Thursday, September 20, 2012 11:20 AM
    • Unmarked as answer by SkyStar11 Thursday, September 20, 2012 9:49 PM
    • Marked as answer by SkyStar11 Thursday, September 20, 2012 9:50 PM
    • Edited by thriggle Wednesday, September 26, 2012 7:04 PM
    Thursday, September 20, 2012 3:12 AM
  • Thanks thriggle for reply,

    Yes, I installed wspbuilder on my server and when I am creating WSP by right click project > WSPBuilder>BuildWSP

    it creates a WSP for me, but it does not includes everything in the package. It only includes one DLL, manifest.XML and cabib.dll.

    it does not includes other files such as -  feature.xml, contact.webpart

    Visual Studio out shows as follow:

    WSPBuilder
    Version: 0.9.9.0728
    Created by Carsten Keutmann
    GPL License 2007
    Building the solution - please wait
    The assembly C:\Users\Administrator\Documents\Projects\test\test\bin\Debug\ssocli.dll is unmanaged and is not allowed in GAC, this assembly will not be included in the WSP package!
    The assembly C:\Users\Administrator\Documents\Projects\test\test\bin\Release\ssocli.dll is unmanaged and is not allowed in GAC, this assembly will not be included in the WSP package!
    More than one test.dll assembly found!
    First found C:\Users\Administrator\Documents\Projects\test\test\bin\Debug\test.dll
    Second found C:\Users\Administrator\Documents\Projects\test\test\bin\Release\test.dll
    The assembly C:\Users\Administrator\Documents\Projects\test\test\bin\Release\test.dll will be used!
    Adding assembly: test.dll
    Could not resolve: Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Please define the -DLLReferencePath with the path to the referenced assemblies. However a SafeControl tag for the test.TL_TestSearchResult class has been created.
    SafeControls added: 1
    Adding assembly: cablib.dll
    Not able to load and reflect on assembly: C:\Users\Administrator\Documents\Projects\test\test\bin\deploy\test\cablib.dll. However the assembly will still be included in the WSP package!
    Saving the Manifest.xml file
    Creating the WSP file
    Cleanup
    Deleting : Manifest.xml
    Done!

    thanks again for your time.

    Thursday, September 20, 2012 3:33 PM
  • Hi SkyStar,

    The "Could not resolve: Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c." message makes me wonder... are you running Visual Studio on a web server with SharePoint installed, or are you running it on a separate development machine?  You may need to build it on a machine where SharePoint is actually installed in order for the assembly references to resolve.

    Where are the Feature.xml and contact.Webpart files that you mentioned?  wspbuilder expects them to be buried in an appropriate FEATURES folder like so:

    You should also check the properties of the files and items you want WSP builder to include.  Pay particular attention to the Build Action property.  If it is set to None, I don't believe it will be included in the output.



    • Edited by thriggle Thursday, September 20, 2012 5:27 PM
    • Marked as answer by SkyStar11 Thursday, September 20, 2012 9:58 PM
    Thursday, September 20, 2012 5:26 PM
  • thanks again thriggle for your help,

    I did two changes based on your suggestion.

    1 - Start developing on the same server, where SharePoint is installed

    2 - It was not including other files, because wrong solution directory Structure, Before I had like this:

    So, Fixed it by moving the folder 12 out as follow:

    Now, I got everything what I needed in .WSP

    Thanks again for your time and help. One last thing, is there any standards for SharePoint Project?



    • Edited by SkyStar11 Thursday, September 20, 2012 9:57 PM
    Thursday, September 20, 2012 6:27 PM