Wednesday, May 9, 2012

This solution contains no resources scoped for a web application and can not be deployed to a particular web application

Recently when I was trying to deploy an event receiver to my SharePoint site using PowerShell I got the error as:

"This solution contains no resources scoped for a web application and can not be deployed to a particular web application".

Also you can check out my previous posts on:

Reusable Approval workflow in SharePoint designer 2010

Mobile apps for SharePoint 2013

- Create Site in SharePoint Online

Install-SPSolution –Identity MySolution.wsp –WebApplication http://mywebapplication -GACDeployment

But I got the error as This solution contains no resources scoped for a web application and can not be deployed to a particular web application. Sometime also you will get error message as "The Project Item EventReceiver1 cannot be deployed through a Feature with Farm scope".

There can be several reason but you can try some solution like below:

Solution-1: 
Right click on the project and press F4. This will open the project properties window. From there Select the Assembly Deployment type From GlobalAssemblyCache to Web Application as shown in the figure below.

Solution-2:
You can also try the below commands by defining local like:
Install-SPSolution -Identity MySolution.wsp -local -GACDeployment

Solution-3:
Also you can try below command:
Install-SPSolution –Identity MyHpIndigoEventReceiver.wsp -GACDeployment

Also you can check some PowerShell articles here.

No comments:

Post a Comment