Monday, August 11, 2008

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

Scenario:
You scoped your solution to WebApplication and trying to deploy the solution to a particular Web Application

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

OR

This solution contains no resources scoped for a Web application and cannot be retracted from a particular Web application.


Reason:
Its because of the parameters passed to STSADM , basically features included in the solution does not contain an assembly which can be scoped to a particular Web Application. What ever assemblies are part of solution are suppose to go GAC and that makes solution a candidate for Global deployment.

Resolution:
Before you read the resolution below: Here's a comment that seems to be more better solution

"Better fix your solution by adding some dummy element that will make the solution deploy-able to a web application. If you have multiple web applications in your farm, usually you don't want to deploy your feature to all of them."

If that is not possible

Remove the URL parameter from STSADM. Do not use the Url parameter with the STSADM command while deploying or retracting such a solution

e.g.  stsadm -o deploysolution -name SolutionFileName -local
stsadm -o retractsolution -name SolutionFileName -local

15 comments:

Anonymous,  January 1, 2009 at 11:40 PM  

thank you , it helped me.

Ronney,  January 13, 2009 at 3:55 AM  

Short and sweet. I would have had to spend hours if I had not stumbled on this post. Great work. Thanks a lot.
Ronney

Anonymous,  September 25, 2009 at 4:55 PM  

Better fix your solution by adding some dummy element that will make the solution deploy-able to a web application. If you have multiple web applications in your farm, usually you don't want to deploy your feature to all of them. This is like asking for trouble.

Christian October 22, 2009 at 9:46 AM  

it sure helped a lot, thanx for that

Anonymous,  January 5, 2010 at 3:18 AM  

Thank you. It helped me too, after half day of search.

westerdaled February 9, 2010 at 7:16 AM  

Hi there


Yes saved me time as well.

"Better fix your solution by adding some dummy element that will make the solution deploy-able to a web application. If you have multiple web applications in your farm, usually you don't want to deploy your feature to all of them."

In the case of a solution with say 3 features: do you mean one or more features that have say "Web" scope and then you can deploy your feature to your desired web app and not globally; even though there is a dll deployed in the gac

Mahdi,  August 24, 2010 at 4:11 AM  

Thank you.
It worked for me.

Mr. September 8, 2010 at 7:12 AM  

thanks a lot. nice explanation.

Dave September 14, 2010 at 5:37 PM  

Can you provide an exmaple of a 'dummy' element?
Thanks

Sandeep K Nahta September 14, 2010 at 10:32 PM  

You got the error while deploying ..right ? remove the -url parameter from your deployment command and you will be fine.

Anonymous,  February 29, 2012 at 8:12 AM  

thnx alot, deployed and retracted now , but how i can register the solution to a custom list ?? my solution is event receiver !!!

Sandeep K Nahta February 29, 2012 at 8:47 AM  

in your solution you can have a feature with feature receiver which can attach your event receiver to a particular list

Manish Gupta June 5, 2012 at 5:36 PM  

Thanks for your suggestion. This worked like a charm for me.

Anonymous,  March 10, 2014 at 3:24 PM  

This is insufficient as when you run the suggested command - the WSP will be deployed GLOBALLY, and not to a particular WEB APPLICATION that you want !!!