I am working on SharePoint, when I tried to deploy a WSP solution that contains an Event Receiver to a specific SharePoint web application, I got the following error message:
This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application
Generally, Event Receiver should be deployed globally to all web application therefore, there is not a scope to deploy it to specific web application as written in the command when trying to install it.
In case of, you don’t have the WSP solution source code,
You should deploy it globally by removing “-WebApplication http://sitename” from Install-SPSolution command, therefore, the command should be as the following:
Add-SPSolution "path of solution .wsp" Install-SPSolution -Identity "solution name".wsp -GacDeployment -force
To make sure that WSP solution has been installed and deployed successfully
- Go to Central Administration > System Settings > Manage farm solutions.
In case of, you are haveing the WSP solution source code
- Go to the properties of your solution and change the Assembly Deployment Target from GlobalAssemblyCache.
- To WebApplication.
- Build & Create WSP and try to deploy it again, It should now been deployed.