Friday, November 20, 2009

This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application when you deploy a workflow

The below error appeared when I tried to deploy a workflow onto a specific web application:
This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application

After a bit of research, I have learnt that a solution with workflow cannot be deployed on a specific web application. It needs to be deployed globally.

Ex: stsadm -o deploysolution -name workflowsln -url http://localhost/ fails

If the solution'manifest.xml file specifies a <SafeControl> element, we need to specify the url parameter when invoking stsadm.exe as 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.

Reference: http://blogs.msdn.com/jjameson/archive/2007/06/17/issues-deploying-sharepoint-solution-packages.aspx