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:
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)
//{
//}
}
}
FeatureDeactivating
method, not the class header of course :)