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

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

You should be 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 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 

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


Note: In 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.
Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s