Using 2 different versions of EF in the same Project

后端 未结 1 1808
孤街浪徒
孤街浪徒 2021-01-23 15:35

In my current Project i have two Project References that are DataContexts. One is for accessing an Oracle Db and is using EF 4.2. The other is accessing a SQL Server and uses EF

相关标签:
1条回答
  • 2021-01-23 15:43

    The difference to the referenced question/answer is that in the other case there are two DLLs that use different versions of a dependency. In your case, you are trying to use two different versions of a dependency within the same project.

    You may try to factor out (wrap) your version-specific code into two DLLs (e.g. OracleDataAccess and SqlDataAccess). In each of those projects you can now reference the specific version of EF. From your main project you then reference the two ...DataAccess projects, and if everything goes well, the dependentAssembly config file entry should resolve the version conflict for the two EF DLLs at runtime.

    Note: You might also need to tweak how the EF dependencies are copied to the build directory to match the hrefs in the config file.

    0 讨论(0)
提交回复
热议问题