Could not load type 'System.Reflection.IntrospectionExtensions', ASP.NET MVC 4 (RC), possibly Facebook C# SDK's fault?

StackOverflow https://stackoverflow.com/questions/11166737

سؤال

I'm developing an ASP.NET MVC 4 (RC) website, runs great on my local dev box.

Deploying to my host (DiscountASP) required me to change <compilation targetFramework="4.5" /> to <compilation targetFramework="4.0" /> even though I bin deployed it.

The site operates fine, until someone who is logged into Facebook, or attempts to connect to my site using their Facebook account (which is nearly all, my membership system uses Facebook primarily), it throws an error:

Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Since it's beta, I'm not worried about leaving the error online at this time, you should be able to re-create the error on my site here.

It appears the Facebook C# SDK is throwing the error, but is it the SDK's fault, or the fact I had to change to 4.0 framework? How could I resolve this?

Update

From what I gather, the System.Reflection.IntrospectionExtensions are new to .net 4.5, which is not on my host. However, my project targets the .net 4.0 framework, and is bin deployed as such. On my development system it runs fine, on host it errors.

هل كانت مفيدة؟

المحلول

Turns out it was the fact I had the project targeting .net 4.5 when I added the Facebook C# SDK reference (and later changed the project to target 4.0).

I removed the reference, ensured my project was set to .net 4.0, and used Nuget to re-install the Facebook C# SDK. Resolved the problem immediately.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top