I'm using Facebook SDK C# Library in Asp.Net 3.5 Application. When I'm trying to compile the code below give me the errors. As I know dynamic type using in 4.0 framework. So is anyway to rewrite it in order make it work? I have a reference to System.Core 3.5 but it's still not compiling
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params.AllKeys.Contains("signed_request"))
{
var result = FacebookSignedRequest.Parse(FacebookContext.Current.AppSecret, Request.Params["signed_request"]);
dynamic signedRequestValue = result.Data;
this.RegistrationData = signedRequestValue.registration;
}
else
{
Response.Redirect("~/");
}
}
protected dynamic RegistrationData { get; set; }
Error 1 Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference to System.Core.dll?
Error 2 Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference to System.Core.dll?
dynamic is available in C# 4.0.
You have to convert your application to 4.0 version Change the referenced assemblies(System.Core) to 4.0 version.
My project was already > 4.0. It was 4.5.2, in fact. I was experiencing this error. What I did to fix it:
I changed the project to 4.5.1.
I changed it back to 4.5.2.
Problem solved!
Thanks - hope this helps someone out there.
PS - not using facebook SDK, but this could help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With