-
Notifications
You must be signed in to change notification settings - Fork 40
Scaffolding does not Work - COMException when calling EntityFrameworkCore.Jet.Data.ComObject.TryGetMember #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My first thought is that this is more likely a bitness problem. You need everything to match for Jet to work. Can you confirm a couple of things
The scaffolding is run under the |
Thank you for your answer. I think it is all x64 but maybe i'm wrong.
I also tried with .NET 7.0 and EntityFrameWorkCore.Jet 7.03 - the result is the same. |
It all looks like it should work. Almost all the time COM Exception tend to be when it can't find the COM class that it needs to create. Generally either because it is not installed or its looking for x86 when you have x64 installed or vice versa. This is the links for the 2016 installer used with the testing system. Have a go at both. You will soon know which one installs as it doesn't like having different bit architecture installed at the same time
My project file is
For the record, my environment has the 2010 x86 engine and Office 365 for x64. Doing the whole suite of tests is a bit more stable in x86 |
Yesterday i tried the following:
--> Same Exception After that i created a new project in the Hyper-V Machine, compiled it and tried to scaffold --> Same Exception I thought, that maybe when using the default language (english) and a brand new machine it will work, but it does not. I'm afraid i have to build the models for the access db manually or try to get it work in a pure x86 environment. Hopefully this will work. |
Installed the Windows 11 dev environment from Hyper V. Came with .Net 8.0.1 x64. I'm starting to wonder if there is a difference with the Northwind database you are testing on. Can you link that so I can look at it? |
Hmm, it looks like it really is the northwind.accdb. I run your WebApplication1 - everything works fine and the models are created. https://github.com/LuckyGeorge1975/Share/blob/main/northwind.accdb EDIT The northwind db was downloaded via Access and not directly from Microsoft. I followed the instructions here: |
Is there a workaround? I am having this issue with a database. Thanks |
In my case, It failed for an external/linked table. I am no expert about that, I don't know if it would make sense to simply ignore them... |
@yepeekai Interesting. Don't think we actually have code that knows how to deal with linked tables. May have to have a look and try replicate |
Some context, I received a copy of that access database so the linked table are obviously not working since I do not have the other database. I deleted all linked tables since I did not need them. I compact/repair and then I get the same error at the same place for table : MSysACEs |
Adding the following lines in AdoxSchema.cs solves it for me.
Workaround (complicated): clone this repository execute scaffold-dbcontext in package manager console for the new console app. |
I think it would be nice to have some kind of error handling in there to also support linked table no longer reachable and maybe log some warning instead of crashing. |
@yepeekai @LuckyGeorge1975 Just added a commit to fix the main issue with the You can now optionally ignore the If you add You can try this out by referencing the daily builds @yepeekai Regarding the linked tables, skipping/ignoring them would only work if they were stand alone. If there was any other foreign key/reference to them you would run into issues |
I've just started a simple project to test if i can read an access db with EF and the Jet Provider. But the scaffolding leads to a COM Exception 0x800A0CB3.
What i have done
Project:
DBContext:
Test:
The Unit Test is successful.
After that i tried to scaffold the DB Context:
This results in the Exception:
I also installed the latest Access Driver Engine but the result is the same.
What am i doing wrong?
The text was updated successfully, but these errors were encountered: