пятница, 28 сентября 2012 г.

Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'.


Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'.
Looks like you are using the EF5 EntityFramework.dll but then running with .NET 4 installed instead of .NET 4.5.
If you are intending to target .NET 4.5, then make sure that .NET 4.5 is installed on the machine on which you are running the code. VS11 installs .NET 4.5 for you, but you can also install just the runtime on a non-dev machine.
If you are intending to target .NET 4, then make sure that you project is set to target .NET 4 and then uninstall and reinstall the EF5 NuGet package. You must uninstall and reinstall because NuGet won't change the assembly in use automatically when the project is re-taregted.
Update:
You may also see this exception if you still have the EF June CTP installed or if it failed to uninstall correctly. Please try to uninstall the June CTP fully before installing VS11. If you still see problems them open a "Developer Command Prompt" as Administrator and run:
gacutil /u System.Data.Entity,Version=4.2.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089
If this still fails, then you can attempt to force the uninstall from the GAC with:
gacutil /uf System.Data.Entity,Version=4.2.0.0,Culture=neutral,PublicKeyToken=b77a

Комментариев нет: