Technology Toolbox

Your technology Sherpa for the Microsoft platform

Jeremy Jameson - Founder and Principal

Search

Search

Issues Deploying SharePoint Solution Packages

Note
This post originally appeared on my MSDN blog:

Since I no longer work for Microsoft, I have copied it here in case that blog ever goes away.

Several weeks ago, I converted our deployment process to use SharePoint solution packages instead of the batch scripts that we had been using in our Development environment. One of the issues that I discovered along the way is that SharePoint is rather finicky when it comes to running the stsadm.exe command to deploy your solution package.

I noted in a previous post that we have created a PublishingLayouts feature containing our custom master pages, images, and stylesheets -- similar in structure to the feature provided in Microsoft Office SharePoint Server (MOSS) 2007. Creating the WSP file was quite straightforward, as was adding it to the solution store, using the following command:

stsadm -o addsolution -filename Fabrikam.Project1.PublishingLayouts.wsp

However, as soon as I tried to deploy the solution using the following command:

stsadm -o deploysolution -name Fabrikam.Project1.PublishingLayouts -url http://foobar/ -local

I encountered the following error:

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

I must have spent 30 minutes trying to figure out why this command did not work (because it worked just fine for other features that I had converted to deploy with WSPs). It turns out that I needed to omit the url parameter:

stsadm -o deploysolution -name Fabrikam.Project1.PublishingLayouts -local

The reason why the PublishingLayouts solution would not deploy with the url parameter is because, unlike the other features, there was no assembly generated for the PublishingLayouts (since it was pure content).

I also encountered the following error when trying to deploy our custom Workflows feature:

Elements of type 'Workflow' are not supported at the 'WebApplication' scope. This feature could not be installed.

I found that I had to omit the url parameter for this solution as well.

I then decided to try omitting the url parameter when deploying all of the other solutions. Without the url parameter, I was able to deploy 7 of our 9 features. The remaining two produced the following error:

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

For these two features, I had to specify the url parameter when invoking stsadm.exe, because the manifest.xml file for the WSP specifies a <SafeControl> element. When deploying these two solutions, SharePoint needs to know which Web.config file to merge the <SafeControl> elements into, and therefore the url parameter must be specified.

The bottom line is that if your solution specifies elements (a.k.a. "resources") that need to be merged into a Web.config file (i.e. "for a Web application") then you must specify the url parameter. If your solution does not have an assembly or if your solution contains workflows, then you cannot specify the url parameter.

Comments

  1. # re: Issues Deploying SharePoint Solution Packages

    December 16, 2009 12:36 AM
    Ed

    I used the cmd line prog (stsadm) to add the solution, but used the GUI in SP Admin to deploy it (Central Mgmt-->Operations-->Solution Mgmt) to deploy it.  In the deploy dialog, I was able to select the url to use.  

    I used this method successfully after attempting to use the cmd line prog 1st.  I was getting the dreaded "This solution contains resources scoped for a Web application and must be deployed to one or more Web applications" then.

  2. # re: Issues Deploying SharePoint Solution Packages

    January 2, 2010 7:54 PM
    Dilli

    Good explanaion on STSADM options

  3. # re: Issues Deploying SharePoint Solution Packages

    July 17, 2011 8:14 PM
    Anonymous

    Thanks. Exactly what I was looking for.

  4. # re: Issues Deploying SharePoint Solution Packages

    July 18, 2011 3:43 PM
    Rakesh Athaluri

    It's Awesome.

    Thanks for your Post.

  5. # re: Issues Deploying SharePoint Solution Packages

    August 10, 2011 5:28 PM
    burn1down

    thanks for the post, it helped me a lot.

    i was having the  no resources scoped for a Web application and cannot be deployed to a particular Web application error and you were the only one that i found with the true answer.

    i had set my vs project do not include an assembly in the gac cause it was pure content.. i just omitted the url in the Install SP-Solution.. yer my hero for the day.

  6. # Links (6/17/2007) « Steve’s SharePoint Stuff

    June 17, 2007 8:10 AM
    stevepietrekweblog.wordpress.com
  7. # Issues Deploying SharePoint Solution Packages

    June 17, 2007 9:06 AM
    www.sharepointkicks.com

Add Comment

Optional, but recommended (especially if you have a Gravatar). Note that your email address will not appear with your comment.
If URL is specified, it will be included as a link with your name.

To prevent spam from being submitted, please select the following fruit: Strawberry

Cherries
Strawberry
Grapes
Watermelon
Apple
Pear
 
Please add 4 and 2 and type the answer here: