Hullo
I trying to devlop a facebook application with ASP.NET MVC and the facebook API.
For authentication with facebook I have the following code
public FacebookAttribute()
: base()
{
ActionParameterFacebookSession = "facebookSession";
ActionParameterFacebookService = "facebookService";
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
FacebookApplicationSettings settings = FacebookSection.GetApplication(ApplicationName);
ApplicationKey = ApplicationKey ?? settings.ApiKey;
Secret = Secret ?? settings.Secret;
This was working before, but now I get the error below *strong text** Server Error in '/' Application. No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.***
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
On investigation, i notice that the MVC bits now have the ActionFilterAbstract class as below (Note the constructor is protected, hence causing the error)
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public abstract class ActionFilterAttribute : FilterAttribute, IActionFilter, IResultFilter
{
protected ActionFilterAttribute();
public virtual void OnActionExecuted(ActionExecutedContext filterContext);
IS this a bug in ASP.NET MVC RC1, beacuse this code worked in ealier releases? Is this the best way to handle a scenario like this?
Please advice.. Thank you