2

I have an issue, my host only supports NET 4.0 so i cannot properly use EF 5.0, so I would like to downgrade, but i do not know how to do that.

I tried just to change version in web.config but it didn't help, i just get errors, when i run application.

Should i do something special and should i then delete and create whole model again?

I didn't choose any versions when i first started with EF, i just followed a small wizard which generated me a model, but i think the model is of EF5

Thanks

Alnedru
  • 2,573
  • 9
  • 50
  • 88

1 Answers1

3

.NET 4.0 is ok. Dont use EF 4.0 because its not about EF version. Just change the target framework to .NET 4.0 of application and dependent libraries. After that you probably going to get some errors. Uninstall and install your entity framework dll from nuget. Because of this:

<package id="EntityFramework" version="5.0.0" targetFramework="net40" />

Then you should recreate your model again. Because some of classes may cause errors which are comes with 4.5 Framework like spatial location...

Yusuf Uzun
  • 1,491
  • 1
  • 13
  • 32
  • package? to what section i should add it? – Alnedru Jun 01 '13 at 19:13
  • packages.config file in your solution. you are using nuget, right? – Yusuf Uzun Jun 01 '13 at 19:18
  • oh right ))) sorry, didn't know that. So then i just recreate everything and correct classes should be generated? – Alnedru Jun 01 '13 at 19:32
  • and still i have this issue: Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'. on a server :( – Alnedru Jun 01 '13 at 19:46
  • can you send code. is it runtime or compile error. You probably didnt change one of your dependent library to .net4.0 check this link [link](http://stackoverflow.com/questions/9591929/can-anyone-spot-why-i-keep-getting-this-error-testing-the-ef-5-beta) – Yusuf Uzun Jun 02 '13 at 12:58