Method not found: "void system. Data. Objects. objectcontextoptions. set_useconsistentnullreferencebehavior (Boolean)

Source: Internet
Author: User
Method not found: "Void system. Data. Objects. objectcontextoptions. set_useconsistentnullreferencebehavior (Boolean )".

Note:An unhandled exception occurred during the execution of the current Web request. Check the stack trace information to learn about this error andCodeDetailed information about the cause of the error.
Exception details:System. missingmethodexception: The method cannot be found: "Void system. Data. Objects. objectcontextoptions. set_useconsistentnullreferencebehavior (Boolean )".

 

Cause:

D: \ Program Files \ Microsoft Visual Studio 11.0 \ common7 \ ide \ extensions \ Microsoft \ Entity Framework tools \ nuget packages \ entityframework.5.0.0 \ Lib

There are two versions: net40 and net45. You can use net40.

 

 

-------------------------------

 

First, you want to directly install the framework on the server. 4. 5. After downloading the installation package and running it, the following message is displayed: Windows 2003 is not supported by the operating system.

No way. You can only solve this problem by modifying the code.

In fact, the solution is very simple, the main problem is: although the compilation version of each class library project selects framework4.0, but the entityframework of EF When referencing. DLL is for version 4.5. therefore, we only need to reference the correct DLL.

My vs2012 is installed on drive C, so entityframework. DLL files are stored in C:/program files (x86)/Microsoft Web tools/packages/entityframework.5.0.0/lib/, which contains net40 and net45. net40 is naturally used in framework4.0.

 

For projects that do not support framework4.5 development in Windows 2003, you can modify the target webconfig framework 4.5 => 4.0, check and copy the 4.5 DLL required by the project, and publish the project.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.