C
C#3mo ago
Brady Kelly

✅ Strange version error with EF.Core

I have a third party exe that references assembly CTSCore.dll. It seems to run fine, and when I examine the DLL I see it has a reference to Microsoft.EntityFrameworkCore.8.0.2.0, yet in the bin folder of the app I see Microsoft.EntityFrameworkCore.8.0.424.16902. Yet when I reference CTSCore in my web api and call a method on one of its classes, I get a FileNotFoundException looking for Microsoft.EntityFrameworkCore.8.0.2.0. 1. How is the exe running while my web api is failing? Looks to me like it should also be causing an exception when EFCore.8.0.2.0 isn't found. I suspect it might be a difference in how the two executables use assembly versions. I don't see why a WinForms app should be different from a Console app though, and the web api is a console app. 2. How can I insulate myself from this?
7 Replies
Yawnder
Yawnder3mo ago
Try adding assembly redirects.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Brady Kelly
Brady Kelly3mo ago
It turned out that I was just missing the EF binaries in the build output of my web api. Stupid of me to have overlooked that.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Brady Kelly
Brady Kelly3mo ago
I'm not using the CLI at all. I'm using Rider's Publish command, which in turn calls does the build it's way, whatever that is.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Brady Kelly
Brady Kelly3mo ago
Thank you so much for your time.