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.