I have 3 projects in my solution:
Data.Mysql, Data.Progress, and MainProject
MainProject uses both Data.MySQl and Data.Progress.
Data.MySQL uses the Pomero-Provider and EFCore 3.11
Data.Progress uses an OpenEdge-Provider and EFCore 2.1.11
The Problem is that Data.Progress tries to use the EFCore 3.11 DLL.
First I noticed that only the 3.11 DLL was created in the output folder.
My first change was adding DestinationSubDirectory to seperate both projects and put them into subfolders:
<ProjectReference Include="..\Data.MySQL\Data.MySql.csproj">
<Project>{050aeca0-c549-43b9-9fed-2cb3311a7239}</Project>
<Name>Data.MySQL</Name>
<DestinationSubDirectory>Data.MySQL\</DestinationSubDirectory>
</ProjectReference>
<ProjectReference Include="..\Data.Progress\Data.Progress.csproj">
<Project>{c8972134-c3bf-4fab-9a35-7d496f464a14}</Project>
<Name>Data.Progress</Name>
<DestinationSubDirectory>Data.Progress\</DestinationSubDirectory>
</ProjectReference>
as well as adding this to the App.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Data.MySql;Data.Progress" />
<dependentAssembly>
<assemblyIdentity name="Microsoft.EntityFrameworkCore" culture="neutral" publicKeyToken="c5687fc88969c44d"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.14.99999" newVersion="2.1.11"/>
<bindingRedirect oldVersion="3.0.0.0-3.2.0.0" newVersion="3.1.9"/>
<codeBase version="2.1.11" href="Progress\Microsoft.EntityFrameworkCore.dll" />
<codeBase version="3.1.9" href="MySql\Microsoft.EntityFrameworkCore.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
One Problem is that Data.Progress does not create a EFCore DLL in the Data.Progress-Folder. So I copied the correct on into the folder manually.
I tried to Load the DLL manually when Data.Progress is used:
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/Microsoft.EntityFrameworkCore.dll";
Assembly.LoadFile(path);
But Data.Progress is still trying to use the EFCore 3.1 DLL! What can I change to use the correct EFCore Version? I think it just tries to use the newest, loaded Version. Can I force it somehow?
Best Regards Christopher