Blog

SharePoint Solution Installer Fix


by Tobias Lekman, 01 December, 2008

When using the SharePoint Solution Installer from CodePlex, you frequently receive the error message (as discussed within the discussions on the site)

 "This solution contains resources scoped for a Web application and must be deployed to one or more Web applications"

This can easily be fixed by changing the code within InstallProcessControl.Open

 1: protected internal override void Open(InstallOptions options)

 2: {

 3: executeCommands = new CommandList();

 4: rollbackCommands = new CommandList();

 5:   nextCommand = 0;

 6:   SPFeatureScope featureScope = InstallConfiguration.FeatureScope;

 7: DeactivateSiteCollectionFeatureCommand deactivateSiteCollectionFeatureCommand = null;

 8:  

 9: switch (Form.Operation)

 10:   {

 11: case InstallOperation.Install:

 12: executeCommands.Add(new AddSolutionCommand(this));

 13: if (options.WebApplicationTargets != null && options.WebApplicationTargets.Count > 0) //Added code

 14:       {

 15: executeCommands.Add(new CreateDeploymentJobCommand(this, options.WebApplicationTargets));

 16:       }

 17: else

 18:       {

 19: // KML TODO - need to get rid of options.Targets? - check with Lars

 20: executeCommands.Add(new CreateDeploymentJobCommand(this, options.Targets));

 21:       }


Add "options.WebApplicationTargets.Count > 0" on line 13.

Until this is fixed in the CodePlex release, feel free to download the fixed .exe file here.