System.NotImplementedException: OleDb

Questions about Wine on Linux
Locked
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

System.NotImplementedException: OleDb

Post by tjobes »

I'm trying to run a technical app written in VB.NET that uses MS Access API calls to read an mdb file to collect data for a simulation run. I'm running on a Linux machine running RedHat, with wine and Mono installed.

When I try, I get instances of Unhandled Exception: System.NotImplementedException: OleDb is not implemented.

If OleDb is not implemented in Mono (or basic Wine), is there another package available to install that would allow Wine to handle these calls?
SetantaLP
Level 3
Level 3
Posts: 54
Joined: Mon Jul 31, 2017 3:55 am

Re: System.NotImplementedException: OleDb

Post by SetantaLP »

You could try to install the corresponding version of .NET (the framework which mono mostly reimplements) via winetricks, but that might be a bit difficult because the installers for some versions of .NET are broken on recent versions of wine.
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

Re: System.NotImplementedException: OleDb

Post by tjobes »

Thanks, we'll give it a try and post how it goes.
fargodwe

Re: System.NotImplementedException: OleDb

Post by fargodwe »

Does this perhaps require the MDAC package to be installed? You can install it via:

Code: Select all

<wineprefix path if needed> winetricks mdac28
Searching online it appears MDAC provides oledb.
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

Re: System.NotImplementedException: OleDb

Post by tjobes »

@fargodwe: After seeing that MDAC includes OLE service, we tried that first, and it did resolve the error - thanks for the tip!

@SetantaFP: Once the OLE error resolved, it's still missing ConnectionManager from .NET, so next we're using winetricks to install .NET. The menu system only refers to v2.0. The technical app documentation wants 4.0.2 or higher. An attempt to use v2.0 anyway failed, popping a dialog asking for .NET 4.0 (I don't know if 4.0 vs 4.0.2 matters, or if the documentation is just being overly conservative.)

A few followup questions:

Can winetricks be made to find and install the latest .NET?
If so, do you install the Windows .NET runtime or the Linux .NET runtime?

Or do you directly install the Linux .NET runtime? We gave this a quick try, just running "dotnet <app> <args>" without using wine, but that failed. Is it even possible to combine Wine and Linux "dotnet" command?
fargodwe

Re: System.NotImplementedException: OleDb

Post by fargodwe »

You might also need jet40. I'm not sure but I think that requires a 32-bit prefix instead of the default 64-bit. It might be that mdac28 requires that as well.
SetantaLP
Level 3
Level 3
Posts: 54
Joined: Mon Jul 31, 2017 3:55 am

Re: System.NotImplementedException: OleDb

Post by SetantaLP »

As far as I know, Linux .NET is missing some parts from Windows .NET (like WPF), so unless your app only uses plain C# (which is definitely supported by Linux .NET) it will probably not run.
Winetricks will definitely install the Windows .NET runtime, because it is designed to install software inside wine and it will install whatever is necessary to have a full version of the .NET version you requested (which means in case of .NET versions like 4.6 that are installed on top of the previous version it will install the required previous versions (in this case 4.5 and maybe some others) before).
Combining Windows and Linux .NET is most likely not possible (at least not out of the box), because the native part uses a completely different binary format (Windows uses PE, Linux uses ELF), which means you would have to use a wrapper (like wine does for system level calls) that redirects calls from one side to the other.
spoon0042
Level 6
Level 6
Posts: 572
Joined: Thu Dec 24, 2009 11:00 am

Re: System.NotImplementedException: OleDb

Post by spoon0042 »

tjobes wrote: Tue Nov 24, 2020 5:21 pm A few followup questions:

Can winetricks be made to find and install the latest .NET?
If so, do you install the Windows .NET runtime or the Linux .NET runtime?
Yes, with any luck 'winetricks -q dotnet40' will get things working. That way winetricks will download and install the "native" windows .net.
Or do you directly install the Linux .NET runtime? We gave this a quick try, just running "dotnet <app> <args>" without using wine, but that failed. Is it even possible to combine Wine and Linux "dotnet" command?
By default wine will use a wine-specific version of Mono, the free .net implementation rather than any system version of Mono or dotnet (not that I'm familiar with either, really). When a wineprefix is created there are a few places wine looks for it or will ask to download it. Some more info on that is here: https://wiki.winehq.org/Mono

Just to check, what wine branch (stable/devel/staging) are you using and what version? And check your winetricks is up to date, packaged versions aren't always updated.
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

Re: System.NotImplementedException: OleDb

Post by tjobes »

We did install dotnet48 using winetricks. It still however complains about ConnectionManager being not implemented.

During the dotnet48 installation, which seems to uninstall any Mono, then install 4.0 first and then an upgrade patch to 4.8 separately, there is a warning dialog that .NET4.0 doesn't install or function completely on wine, ending with "caveat emptor". I assume this is somehow involved in the failure of the application to find ConnectionManager.

The version of wine is 5.0.2. The version of winetricks is reported as "20200412-next" followed by the sha256sum: 556389c6dc075e86b78b45dcd44824c14004a888f95a8a418ea8c059f04c1c3d

I've seen that there is a newer wine version 5.2, which I think is not yet stable. If however it might fix the dotnet problem, it's probably worthwhile to try it. Does anyone know if the newer version addresses this?
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

Re: System.NotImplementedException: OleDb

Post by tjobes »

@fargodwe - installing jet40 did get me past both the OleDB and ConnectionManager obstacles - thanks so much for the tip! I had to rebuild the wineprefix with dotnet48 first, then MDAC2.8, then jet40. Jet40 also installed MDAC2.7, so the separate MDAC2.8 install might not be necessary - I haven't done that experiment yet.

An oddity about the jet40 installation is that I needed to have a Linux package called cabextract installed by the sysadmin, so that winetricks could use it to handle the old Cabinet file format apparently still being used here.

Of course now there's another crash. I'll post that separately in a new thread, since it seems to be a different issue entirely, although still with .NET
fargodwe

Re: System.NotImplementedException: OleDb

Post by fargodwe »

I'm glad that helped. I have an app the requires mdac and jet40 and someone here was very helpful in getting that all working for me. They found that the order of installing mdac28 first and then jet40 (I used the command line to install each one at a time). Jet40 installs mdac27 but apparently mdac28 was needed and then whatever mdac27 may have "downgraded" in some way - I don't understand that stuff. At any rate I'm glad you had that covered.

My last iteration of that problem was solved by some great help from spoon0042. In particular, I had to run winecfg on the prefix do 2 things under the "Libraries" tab
  • add an override for odbccp32.dll as native,bultin
  • be sure msado15 shows as native,buitin - if not add that as an override as well.
If the wine version is above 4.4 - which any of the new obviously is, winetricks no longer does those overrides when you install mdac. I contacted the help on winetricks about this and they said that while mdac itself no longer requires those overrides in winetricks that there are a lot of apps and installers that still require those overrides when you install mdac.

Maybe that will help you.
tjobes
Level 2
Level 2
Posts: 14
Joined: Mon Nov 23, 2020 4:32 pm

Re: System.NotImplementedException: OleDb

Post by tjobes »

I'll keep the override in mind if there are further database connection issues once our other problem is resolved.

Thanks so much!
Locked