locked
Building WSP solution using WSPBuilder RRS feed

  • Question

  • Hi,

    I'm new to SharePoint development and am looking for some help on building solution packages using WSPBuilder. There are many articles on google showing how to build the wsp using the wspbuilder visual studio extensions and I'm able to build, deploy, and uninstall the wsp using visual studio. But I don't find any detailed articles on how to do this using the command line.

    1. Can someone give a step by step procedure for this?

    2. Also when I try to deploy the solution built using wspbuilder manually using stsadm, it asks for when to deploy and 'allowgacdeployment' arguments which I think correspond to the Solution Management to the Time and GAC deployment options. But once I give these arguments it returns the following:

    C:\>stsadm -o deploysolution -name MossSolution.wsp -url http://mossdev1 -immediate -allowGacDeployment

    This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web a
    pplication.

    But when I click on deploy using the GUI, it is says 'Deployed globally'. Why this difference between stsadm and the GUI?

    Thanks,
    Connor.
    Thursday, August 21, 2008 7:30 PM

Answers

  • you have done it right with 

    C:\>stsadm.exe -o deploysolution -name MossSolution.wsp -immediate -allowgacdeployment

    this will deploy it globally. i will check some time later for allcontenturl. i have couple of batch files to deploy WSP files at some customers. i will check them to see again in which scenario we used allcontenturl. but my above reply about not specifying a URL is correct that in case when WSP contains only dll for GAC, you should not specify a URL.

    Thursday, August 21, 2008 9:17 PM

All replies

  • in case of your message, your WSP only contains dlls for GAC. they have no ascx or 12 hive folder location files etc. so thats why you get this message. you need to use [-allcontenturls]  switch and no full URL. this way your dlls will be deployed to GAC. if your WSP contain any feature or any other file that goes to 12 hive sharepoint folders then deploying WSP to a specific Web App URl works. otherwise you just need to say deploy to all content URLs and no specific web app. because it is a DLL going to GAC and no other file in WSP.
    Thursday, August 21, 2008 8:01 PM
  • Hi Moonis,

    Thanks for the reply! I tried what you said by using the -allcontenturls switch but the same result. This is what I did:

    C:\>stsadm.exe -o addsolution -filename MossSolution.wsp

    Operation completed successfully.

    C:\>stsadm.exe -o deploysolution -name MossSolution.wsp -allcontenturls -immediate -allowgacdeployment

    This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.


    But when I tried this, it deployed.

    C:\>stsadm.exe -o deploysolution -name MossSolution.wsp -immediate -allowgacdeployment

    Timer job successfully created.

    So I'm not sure why this happens. Am I doing something wrong here?

    Thanks,
    Connor.

    Thursday, August 21, 2008 8:49 PM
  • you have done it right with 

    C:\>stsadm.exe -o deploysolution -name MossSolution.wsp -immediate -allowgacdeployment

    this will deploy it globally. i will check some time later for allcontenturl. i have couple of batch files to deploy WSP files at some customers. i will check them to see again in which scenario we used allcontenturl. but my above reply about not specifying a URL is correct that in case when WSP contains only dll for GAC, you should not specify a URL.

    Thursday, August 21, 2008 9:17 PM
  • Hi ,

    I have the same problem as your first one.

    Can you able to build the command lines for wspbuilder to create wsp file?

    Can you guide if you have the solution.

    Thanks,
    Rama
    Monday, October 20, 2008 8:59 PM
  • what is your issue? any error message like solution does not contain resources for specified URL etc? if yes please go through above posts and you will see the solution.

    you can use WSPBuilder in a way that you put this on a drive for example D drive and create a folder and name it for example myWSPBuilder etc. now use command line to execute a command of WSPBuilder.exe with a switch that will create sub folders like 80 TEMPLATES etc. these folders reflect the same folder structure as sharepoint has 80/bin or 12 hive location folder and you put your files that needs to be deployed (your custom dlls, aspx files or ascx files etc) in required folders. After that you only double click on WSPBuilder and it creates a solution package WSP file on the same location as WSPBuilder.exe is.

    now your WSP is ready. after this you can write a batch file to deploy this WSP. batch file helps you in a way that you can create a folder for your WSP and put your WSP file & batch file in it and put this on another server and simply execute batch to deploy the WSP etc. 

    Monday, October 20, 2008 9:29 PM
  • I have visual studio solution created from wspbuilder extensions for visual studio 2005.

    I have bunch of code (site definition,list templates,features....) and can able to build and deploy from visual studio wspbuilder options.


    Now i want create NANT scripts for my projects.

    I kept Wspbuilder in some folder common to all the project inside my solution folder and i have to write command lines to automate deployment process.


    So i tried test command lines in the following way

    WSPBuilder -SolutionPath C:\MyProject -Outputpath C:\MySolution

    But it's creating blank wsp files with some 300 bytes of data.

    but it supposed to be 60kb.So i tested inside content by changing it's extension to .cab.

    I found first one is empty one.


    i have already tested your way(wspbuilder.exe inside project and than run) and worked perfectly.

    I think you got my Question.

    It's failing when project  and wspbuilder are in different directives.

    Thanks for your response.


    Monday, October 20, 2008 11:13 PM
  • i have worked out this.

    we have to include project path to the command.


    WSPBuilder -ProjectPath C:\MyProject -SolutionPath C:\MyProject -Outputpath C:\MySolution

    Thanks,
    Rama.

    • Proposed as answer by Rama._ Monday, October 20, 2008 11:28 PM
    Monday, October 20, 2008 11:28 PM
  • Hi,

        I have developed an event handler for the task list as a feature, which overrides the ItemAdding,ItemDeleting and ItemUpdating event.
     I have even deployed the same on the server using the  WSPBuilder.

    In the process of using the WSPBuilders, on creating the deployment folder I got a folder called "deploy"  in the "bin" folder.The deploy folder contains a folder, which again contains the deployment files like deploywithstsadm.bat, deploywithstsadmnocontenturls.bat, deploywithwspbuilder.bat  ......

    For my project i used the deploywithstsadmnocontenturls.bat file, and deployed it. It gets deployed sucessfully.

    The problem here is that the feature is getting deployed "Globally", how can i deploy it to a particular site like "www.testsharepoint.com". ??????

     

    With regards

    Biju

     


    Biju Software Engineer,MCP
    Friday, September 4, 2009 6:11 AM
  • Hi Rama,
    Can you share the nant script snippet? I would like to see how we can call wsp builder from NANT to build a wsp file
    Regards,
    Monday, October 12, 2009 9:46 PM
  •    
    Here is the code.

    <call target="compile" />


      <target name="compile">
          <!-- perform heavy lifting for compile here -->
             <echo message=" ----- Begin Compile${compile.num} ----- " />
      
             <echo message="compiling project = ${project.name}" />
             <echo message=" ----- End Compile${compile.num} ----- " />
                    <exec program="${solution.root.dir}\References\Wspbuilder\WSPBuilder.exe" workingdir="${solution.root.dir}">   
                          <arg value="-SolutionPath" />    
                          <arg value="${solution.root.dir}\${project.name}" /> 
                          <arg value="-Outputpath" /> 
                          <arg value="${solution.root.dir}\${project.name}" />
                          <arg value="-ProjectPath" /> 
                          <arg value="${solution.root.dir}\${project.name}" />
     
                    </exec> 
            </target>


    Hope this helps.
    Monday, October 12, 2009 10:06 PM