Merging Sharepoint WSP solution files - sharepoint

I have multiple projects/wsp solutions for my different Sharepoint webparts and event receivers. This is fine for development, however I would like to merge the resulting .wsp files into a single one for production deployment.
Is there a way to do so? I am using vsewss 1.2 only.

This is going to be painful, but to really do this correctly for production pushes you should drop vsewss 1.2, re-organize your projects inside of Visual Studio and use WSPBuilder.
WSPBuilder is great because it takes a lot of the manual work out of creating manifest, ddf and compiling the CAB.

You are going to have to do a lot of the work that vsewss is doing in the background your self. there is a artical on MSDN about the basics on creating a WSP Creating a Solution Package in Windows SharePoint Services 3.0
A WSP is a cab file that contains a manifest.xml and a file structure, it is imortant that you place files in the right location in the WSP so they are deployed to the right location in SharePoint.
I agree with JD
This is going to be painful, but to
really do this correctly for
production pushes you should drop
vsewss 1.2, re-organize your projects
inside of Visual Studio and use
WSPBuilder.
This would be a good time to restructure you code and assembly structure so as to minimise the number of assemblies you need to deploy.
If you have any Web Parts be sure to check that the Feature xml files are all corect as vsewss preparses and does text replacment befor generating its WSP files.
It commanly stores a guid in the file where a full assembly name is requierd.
If you are going to be doing a lot of SharePoint dev work it is probly worth spending a bit of time learning how the manafest.xml and rest of the WSP packages work.

I haven't seen a tool which does this, but it shouldn't be hard to create:
Unzip the wsp packages (They're just
cab files with an odd extension)
Merge the directory structures
Merge the manifest.xml files
Zip the combined package

There is an advantage to not having all your code in a single WSP.. you can do partial deployments and you don't have all your code in a single gigantic Visual Studio Solution.
Why don't you script all WSP deployments in 1 script file? It seems a far more transparent solution than fiddling with the WSP itself.

Related

Create Web Deployment zip file from TFS build

Using TFS 2010 and I have a build project consisting of 2 solutions. One is a MVC solution with web pages the other is a solution containing multiple projects. These are various WFC services. I have added the criteria to publish each project in both solutions.
If I build either of them from VS - I get the zip files created.
If I use msbuild from a command prompt and build the WFC solution - I get the zip files.
Same for the MVC.
I then have a build project that builds both solutions, and I have as parameters
/p:DeployOnBuild=true;DeployTarget=Package
When I submit that build - it completes. But in the "_PublishedWebsites" folder I only get a package for the MVC project.
I've tried a LOT of variations but can't get the WFC solution to create the packages for the projects. I even named the pubxml files the same in each WFC project and tried passing that in as another parameter but the same results - MVC is correct; nothing for the WFC.
Even tried changes to Debug|AnyCPU versus Debug|Any CPU (space added).
I am thinking I have some little thing off that is biting me - but I can't find it.
Appreciate any assistance!
The WCF projects need to have been created as Web Applications and not just Websites. The default behavior you want is only available in Web Application.
There is walkthough on how to do the conversion on MSDN (http://msdn.microsoft.com/en-us/library/aa983476(v=vs.90).aspx). I tend to modify the documentation to be an in place upgrade by creating a blank web application and copying the project file over the top of the existing location.
You can then open that new project in VS (giving you two views of the same thing) and then adding the hidden files. Once working you can then delete the WebSite project and you will be left with thebWeb Application that will output to _PublishedWebsites.

Deploying a content type and site columns with a WSP in MOSS

I'm looking for a clean, and repeatable, solution to deploying custom site columns and content types to MOSS using a WSP. I've currently split up my product into two Visual Studio solutions. The first contains the code itself where the second will contain the XML files required to describe the site columns and content types.
We use Vsewss for this, there is also a tool WSP Builder. Both of these tools will help you build the xml and wsp files.
We then create setup projects that build an MSI to deploy these files and run the activation.
You might consider merging the code and the other files into one VS solution. This is often easier to manage and will allow you to leverage either VseWss, WSP Builder, PowerShell or .bat files to aid with building and deploying the .WSP file.

WSPBuilder: How to create a deployment package to deploy .dll and .wsp?

I'm using WSPBuilder and it is being very helpful. However, it was being hard to understand the strength of WSPBuilder because of missing manual. I've to create a solution file to deploy "Return of SmartPart" (.wsp file), "Application Template Core" (.wsp file) and also "AJAX Extensions" (.dll files). So, I won't have to edit the web.config to mark them safe controls. Please, suggest HOW?
Quick answer:
C:\Program Files\WSPBuilder\WSPBuilder.exe.config
(or where ever you've installed it)
add key="BuildSafeControls" value=""
Long answer:
WSPBuilder is great for when you want to do a quick deployment via Visual Studio to your SharePoint installation. I have found that that it gets harder to configure when you need to deploy CAS policies but I'm sure they will do work in this area for future versions.
WSPBuilder in your scenario can automatically build and deploy the safecontrol entries that need to go into your site. Good thing about WSP's are that once you retract a solution, it will also go back and remove the safecontrol entries so you don't need a tidy up job.
Regarding different projects, if you need to install third party wsps, then WSPBuilder hasn't been designed for that purpose, I suggest a simple batch file with some stsadm commands. If some of these solutions are your own code, you should divide each into a different VS project and build their WSP's seperately. You may even need to divide them into different .sln (solution files) but I've not tried this way myself so couldn't say for sure.
Personally, I would only use use WspBuilder to build deployment packages that need to be deployed to live environments if I can be sure its not adding extra bits that may become a problem. Therefore you'll need to think about WSPBuilder wsp's are good enough for you.
Recently I came accross an issue with CAS policies and decided to make my WSP's manually. Under the hood, WSP files are CAB files, you can just create a CAB file and rename its extention to .WSP. I would advise, creating a WSP, rename it to mysolution.cab. Open it and up and extract the files, and have a look to see whether its doing what you want. Key file to look at: manifest.xml.
As far as I know, you can't nest WSP files in other WSP files. You'll have to install those separately.
If you want to install DLLs (other than the one that's built as part of your WSPBuilder project), create a folder in the project called GAC and put them there. All DLLs in that folder will be installed to the GAC when the WSP is installed.
To install a WSP package, you'll need to run:
stsadm -o addsolution -filename MyFeature.wsp
You can then deploy it from SP Central Administration.
You can also create a WSP file manually without WSPBuilder - it's a CAB archive and you can create a WSP file using the makecab.exe utility that comes with Windows and an additional description file that lists the files that should end up in the WSP file.

How to prevent VSeWSS 1.3 from adding assemblies to the solution manifest

I recently upgraded my SharePoint development machine to VSeWSS 1.3 and have noticed a behavior that I didn't think existed before. I have two custom web parts that use several common assemblies, and both will live in the same site. I'm trying to create a third 'common' web part that copies these files to the Bin folder and adds safe control entries to web.config so I can remove one of the web part solutions, if needed, without crippling the other one.
With the prior version of VSeWSS I thought it only included assemblies in the manifest if you included them in the given Visual Studio project. I've removed the common assemblies from the two web part projects, but entries for them still end up in their solution manifests. Obviously the extensions are looking at the references for the web part and going by that, even if the file are in another directory alltogether.
Is there any way to tell the extensions to not add assembly entries to the manifest even if they are referenced in the project? Or is there a better way to separate the common code from the web parts that use it?
Yes you could prevent VSeWSS from deploying assemblies. Just select the assembly in the list of referenced assemblies in you VS project and look at its properties. There you can find the option "LocalCopy", which you have set to false to prevent the assembly from being deployed.

Packaging multiple features into a single WSP solution file

I am working on a sharepoint feature which includes a couple of list definitions, 2 webparts, a feature receiver assembly and an InfoPath form.
I have to use WSPBuilder to package these, and the requirement is to package all these features into a single WSP solution file.
Now, WSP builder requires the deployment files in a particular folder structure, same as the 12 Hive of sharepoint.
My problem is that all my features were developed separately, and consist of multiple project files, and these are not necessarily in the same folder structure..
How do I use WSP Builder to package multiple features into a single WSP solution?
Maybe this will help: http://www.codeplex.com/wspbuilder/Thread/View.aspx?ThreadId=43125
Ultimately, I think you gain a lot of flexibility by building your own wsp files by using a tool like NANT.
There's no particular action you need to undertake in wspbuilder to have multiple features in the same solution package.
All you need to do is create a new folder for each feature under the 12\TEMPLATE\FEATURES folder inside your solution in Visual Studio and place the appropriate feature.xml file in that folder. For example, you may have:
12\TEMPLATE\FEATURES\FancyFeature\feature.xml
12\TEMPLATE\FEATURES\ReallyCoolFeature\feature.xml
... and so on.
Upon building the solution, wspbuilder will read the entire tree structure of your 12 folder and append the corresponding nodes in the wsp's manifest.xml file. The same goes for any other possible subfolders inside the "TEMPLATE" folder, including IMAGES, LAYOUTS, etc: at deployment time they will all be copied in the correct folder inside the real 12 hive, because the 12 folder inside your solution is meant to be a replica of the original one.
For a better understanding, create some folders and files inside your 12 folder in the visual studio solution, compile your project and look inside the generated manifest.xml file.
The simple answer is that you are going to have to copy all the files form the individual projects into one master project for your solution. As long as all your individual feature files are in the correct location in your '12' folder then you'll be good to go.
Note: You'll need to check all your references to any assemblies as this solution will create 1 assembly for all your custom logic.
I had trouble adding dlls to the wsp so I wrote a short article about it: How to Add DLLs to a WSP Solution
I usually have one project in the solution designated as the "main" one. I set the dependencies so that this "main" project is built last. Then for the other projects that I want to be included in the wsp package, I edit the "Post Build Events" to xcopy the contents of the 12 folder and that dlls built by the projects into corresponding folders for the main project. Then after I build the whole solution, I can build the wsp package for the main project and know that it contains everything.

Resources