2

Recently I've added an event receiver to a sandbox feature, but since I added it, whenever I try to deploy the feature, I always get the message

Error occurred in deployment step 'Add Solution': The site collection containing this sandboxed solution has exceeded its daily resource usage quota.

However, if I just package it into a WSP and upload it to Solutions Gallery, this is what I see in it: enter image description here I thought it might be something related with the Event receiver code, so I commented the FeatureDeactivating method in the EventReceiver which I had initially override, however I still got the same error. I'm out of ideas to what look for next. Any suggestions? I only get the error when I try to activate the solution.

EDIT The error can't be from the daily resource usage quota. As the image shows, the quota is not actually used. Besides that, I increased the quota to its maximum value of 999999. Right now if I remove the event receiver the web part deploys just fine, but if I add an event receiver it just fails. As you can see from the below, the ER code doesnt do anything special so really don't understand why the error. This is my ER code:

using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;

namespace <IP name>.Features.<IP name>
{
  /// <summary>
  /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
  /// </summary>
  /// <remarks>
  /// The GUID attached to this class may be used during packaging and should not be modified.
  /// </remarks>

  [Guid("6b455839-1abc-4087-b4cb-8af7216abd18")]
  public class <IP name>EventReceiver : SPFeatureReceiver
  {
    // Uncomment the method below to handle the event raised after a feature has been activated.

    //public override void FeatureActivated(SPFeatureReceiverProperties properties)
    //{
    //}


    // Uncomment the method below to handle the event raised before a feature is deactivated.

    public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
    {
      Console.Write("Feature deactivating");
    }


    // Uncomment the method below to handle the event raised after a feature has been installed.

    //public override void FeatureInstalled(SPFeatureReceiverProperties properties)
    //{
    //}


    // Uncomment the method below to handle the event raised before a feature is uninstalled.

    public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
    {
      Console.Write("Feature uninstalling");
    }

    // Uncomment the method below to handle the event raised when a feature is upgrading.

    //public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)
    //{
    //}
  }
}
7
  • Maybe this is because your Feature ER fails: 1. Your code fails. 2. If you completely comment the class, it may also fail, since the feature references a class that does not exist...
    – Evariste
    Feb 5, 2016 at 12:09
  • What's does "ER" stand for? I should've been more detailed, when I said I commented the whole class, I meant I've only commented the FeatureDeactivating method, not the class header of course :) Feb 5, 2016 at 12:13
  • 1
    ER = Event Receiver
    – Evariste
    Feb 5, 2016 at 12:15
  • Did you try to increase the quota, juste to see?
    – Evariste
    Feb 5, 2016 at 12:17
  • FYI, here [social.msdn.microsoft.com/forums/sharepoint/en-US/… they state it's OK in SharePoint Online, but not on-premises... Could be then a "simple" matter of (quota) configuration. Where do yo try to deploy: dev machine, on-prem, SharePoint Online?
    – Evariste
    Feb 5, 2016 at 12:23

2 Answers 2

0

I think the problem really comes from a resource quota being exceeding at the site collection level. Note that the error message mentions the "daily quota". So maybe you had several tries in the day, each resulting in increasing the resource counter (if you had unhandled errors for instance).

So, the first suggestion it to try by increasing the quota for the site collection: open the Central Administration, go to "Application Management", "Configure quotas and locks", select the correct site collection in the selection list, and (really) increase the limits.

Note: here's a link on how to tune the granular limits of resource.

0

When you use a Sandbox Solution in your site collection, By default SharePoint set the Resource Quota 300 server resources. Same thing also applies to office 365.

This capability is critical to maintaining the stability of the farm.Quotas for sandboxed solutions are measured in units of resource "points." Resource points are a calculated value that takes 14 different factors into account. The farm administrator assigns a number of points to a site collection that represents the resource usage allowed per dayRead more here: Administrating Sandboxed Solutions

Now you have to option, after wait for day end when this limit reset to zero or you can increase the limit by doing this

Central Administration >> Application Management >> Configure quotas and locks >> Pick the target site collection.

enter image description here

Read more: http://www.sharepointdiary.com/2012/02/fix-site-collection-containing-this-sandboxed-solution-has-exceeded.html#ixzz3zKlIj3xW

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.