Skip to content
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

InvalidOperationException: 'The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine #3

Open
tekeroth-snapcode opened this issue Nov 15, 2023 · 7 comments

Comments

@tekeroth-snapcode
Copy link

When opening the Shapfile, I get this:

InvalidOperationException: 'The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.'

Found a SO thread on it:
https://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine

But installing that driver does not change anything for me, nor do I have any connectionStrings, as they talk about.

Running Win11, dotnet framework 4.7, VS 2022.

@abfo
Copy link
Owner

abfo commented Nov 15, 2023

There are two ways to handle this. If you target your application at 32-bit (x86) then the JET driver should work. You can also install System.Data.OleDb and try the alternate connection string ConnectionStringTemplateAce in Shapefile.

@tekeroth-snapcode
Copy link
Author

Hello! Where does one set the connection string?

@abfo
Copy link
Owner

abfo commented Nov 15, 2023

There is a constructor overload that takes the connection string as an argument, and there are two defined options for JET and ACE in Shapefile. The default is JET.

@eithe
Copy link

eithe commented Jan 3, 2024

I guess this means that using this library in a .NET 7 application running on 64bit linux is not supported @abfo ?

@abfo
Copy link
Owner

abfo commented Jan 6, 2024

Not something I've tried. You could install System.Data.OleDb and experiment with the connection string. I think that package should work on Linux.

@eithe
Copy link

eithe commented Jan 9, 2024

Thanks for the suggestion, @abfo, but unfortunately System.Data.OleDb is not supported on Linux even though the package is available for .NET core/6/7/8. Getting "System.Data.OleDb is not supported on this platform" when on Linux.

For anyone else seeing this: I wasn't very good at researching when I first looked for Shapefile readers in .NET. Now I see that NetTopologySuite (which we actually already have in our project) supports reading Shapefiles through ShapefileDataReader.

@abfo
Copy link
Owner

abfo commented Jan 11, 2024

Sorry to hear that, and glad you found a solution that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants