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

In this post, we will learn how to fix “This solution contains no resources scoped for a Web application and cannot be deployed” error that you may face when deploying an Event Receiver in SharePoint Server.

You might also like to read Install and deploy SharePoint Solution Package (WSP) Using PowerShell


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

When I tried to deploy a SharePoint WSP solution that contains an Event Receiver to a specific SharePoint web application, I got the below error message:

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

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

Cause

To avoid this issue, you should be first aware of the Event Receiver should be deployed globally to all web application, you shouldn’t specify a specific web application scope when deploying the Event Receiver.

Solution

Deploy an Event Receiver in SharePoint using PowerShell 

You should deploy the Event Reciever globally by removing “-WebApplication http://sitename” as the following:

Add-SPSolution "path of solution.wsp" Install-SPSolution -Identity "solution name".wsp -GacDeployment -force
Deploy an Event Receiver using PowerShell 

Check the deployed solutions status in SharePoint

Once the cmdlet is executed successfully, make sure that the SharePoint solution has been deployed properly by doing the following:

  • Go to Central Administration > System Settings > Manage farm solutions.
Manage Farm Solutions In SharePoint
solutionmanagemnt

Deploy an Event Receiver in SharePoint using Visual Studio

In case you will deploy the Event Receiver directly from the Visual Studio, you should set the “Assembly Deployment Target” to “WebApplication” as the following:

  • Open the Event Receiver SharePoint Solution.
  • Go to the Solution “Properties“.
  • Change the “Assembly Deployment Target” from “GlobalAssemblyCache“.
assembllydeploymenttarget
  • To “WebApplication“.
assembllydeploymenttargetwebapplication
  • Build the solution.
  • Deploy the generated WSP Solution that should now be deployed properly.

Applies To
  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.
See Also

1 thought on “This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top