Error: Entity framework "Cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter"

Entity Framework ERROR: Cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter[]' entity framework 6


This is one of most frequent compile time error you may face in Entity Framework. This is because either of:

1. Version conflict or
2. Namespace used.


By default, while compiling project, framework includes namespace using System.Data.Objects;


Solution:

To fix this issue:

If version conflicts, install package for respective version of EF.

If version is same, change the above namespace to System.Data.Entity.Core.Objects 


Comments

  1. How do I identify 'version conflict' i.e. what versions are conflicting and how do you update so they are the same?

    ReplyDelete
    Replies
    1. Oops! I missed your question, sorry for that. This type of issue causes mainly bcs. of multiple version of installed package. Two ways you can rectify this:

      1. Define version numbers in web.config file.
      2. Remove packages those are no longer use and re-install specific version. This will be easier way.

      Hope this will help to those who is facing similar issue.

      Thanks!

      Delete

Post a Comment

Popular posts from this blog

A new threat to users on “Incoming Calls” – VISHING

Session Storage - a client-side state management technique

HTTP Error 500.21 - Internal Server Error: ExtensionlessUrlHandler-ISAPI-4.0_32 bit has a bad module