I recently created a custom error pages feature that was scoped to “WebApplication”. I ran the STSADM “addsolution” command then went to Central Administration -> System Settings -> Manage farm solutions -> mySolution.wsp -> Deploy Solution. I noticed that the “Deploy To?” value was set to “This solution deploys globally.” and no configurable options were given. In order to get a list of web application options in the “Deploy To?” setting, I had to add a SafeControl to the package manifest of the solution, in Visual Studio. It was a really simple fix. Here is what I did:

  1. Open your solution in Visual Studio
  2. Solution Explorer -> Package -> (double click) Package.package
  3. Click the “Manifest” button near the bottom of the Package.package window
  4. Click the “+” button next to “Edit Options” to expand the manifest template area
  5. Click the “(Open in XML Editor)” link
  6. Here is what my Package.Template.xml contained before modifications:
    <?xml version=”1.0″ encoding=”utf-8″?>
    <Solution xmlns=”http://schemas.microsoft.com/sharepoint/”>
    </Solution>
  7. Here is what my Package.Template.xml contained after modifying and saving (be sure to change “mySolution.dll“):
    <?xml version=”1.0″ encoding=”utf-8″?>
    <Solution xmlns=”http://schemas.microsoft.com/sharepoint/”>
    <Assemblies>
    <Assembly Location=”mySolution.dll” DeploymentTarget=”GlobalAssemblyCache”>
    <SafeControls>
    <SafeControl Assembly=”$SharePoint.Project.AssemblyFullName$”
    Namespace=”$SharePoint.Project.FileNameWithoutExtension$” TypeName=”*” Safe=”True”></SafeControl>
    </SafeControls>
    </Assembly>
    </Assemblies>
    </Solution>
  8. Then I did a rebuilt the solution (not sure that it was necessary) and I repackaged the solution. This updates the .wsp file.
  9. Make sure the existing “mySolution.wsp” is removed from Central Administration’s farm solutions gallery.
  10. Run the STSADM “addsolution” command for the updated .wsp file
  11. Central Administration -> System Settings -> Manage farm solutions -> mySolution.wsp -> Deploy Solution
  12. In the “Deploy To?” setting, you should now see “Choose a Web application to deploy this solution:” along with a drop down list of web applications to choose from

 

Advertisements