Home > Forum > Plugins > Trouble with different runtime environments of service (.NET Framework) and portal (.NET Core) and System.Data.ODBC

Trouble with different runtime environments of service (.NET Framework) and portal (.NET Core) and System.Data.ODBC
0

Hello Community,

We have problems with the different runtime environments of the WBCON Workflow Service (under .NET Framework) and the WEBCON BPS Portal (under .NET Core) and System.Data.ODBC.

I have developed an SDK plugin that integrates the NuGet package System.Data.ODBC to access ODBC data sources.

The target runtime environment of the plugin package is .NET Standard 2.0, so that the plugins can be executed both in the service and portal. Without the integration of System.Data.ODBC this works without any problems.

As soon as the NuGet package System.Data.ODBC is integrated and used, the plugin only works in the portal (.NET), but no longer in the service (.NET Framework).
I have tested different System.Data.ODBC versions (6.0.0.0, 7.0.0.0, 8.0.0.0), but I always get the following error message (the version number in the error message is always identical to the System.Data.ODBC version used):

System.IO.FileNotFoundException: the file or assembly "System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" or a dependency of it was not found. The system cannot find the specified file.
File name: "System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Only exception: on my local Windows 11 machine, on which I develop the plugin, the plugin also works in service when I use System.Data.ODBC version 6.0.0.0.

I've already spent hours trying to find the unresolved dependency and looking for differences between my local Windows 11 development environment. Unfortunately without success so far.

I think it might be a similar problem to the following forum post, but I'm not 100% sure.
https://community.webcon.com/forum/thread/2707?messageid=2707

Is there anyone here who can help me with any tips? The case is quite urgent, as the plugin has not worked for a customer since the WEBCON update last Friday and it is used intensively in applications for this customer.

Thank you!
Marco Bienlein, VSB

MVP

Hi Marco,

we aren't using it and unfortunately I don't have time to check this out on my own.

Maybe you can check out this approach.
https://raluca.encorsa.ro/?p=107

The blog post mentions this project, check out the readme as there may be other options.
https://github.com/Fody/Costura

I've read up on this when the post was released, but I haven't used it myself.

Best regards,
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Marco,

we aren't using it and unfortunately I don't have time to check this out on my own.

Maybe you can check out this approach.
https://raluca.encorsa.ro/?p=107

The blog post mentions this project, check out the readme as there may be other options.
https://github.com/Fody/Costura

I've read up on this when the post was released, but I haven't used it myself.

Best regards,
Daniel

I carried out a series of tests and documented them:

My Visual Studio solution / project structure:
- see attached Image "Project Structure - NuGet Packages.png
- there are three projects: 'ClassLibrary', 'ConsoleApp' and 'MoB.ODBCNetStandardTest'
- the target runtime of 'ClassLibrary' is '.NET Standard 2.0' and includes 'System.Data.ODBC' as a required NuGet package
- the target runtime of 'ConsoleApp' is 'NET 6.0' and includes 'ClassLibrary' as a project dependency
- 'MoB.ODBCNetStandardTest' is the plugin package project, targets to '.NET Standard 2.0', includes 'System.Data.ODBC' as a required NuGet package and has no link/dependency to the two other projects

The 'ClassLibrary' / 'ConsoleApp' construct was a hint from WEBCON support in an older support ticket for the 'System.Data.ODBC is not supported on this platform.' error (see below) occurred after changing the portal runtime in 2022.1 by WEBCON.
The trick is to take the 'System.Data.ODBC.dll' file from 'ConsoleApp'\bin\Debug\net6.0\runtimes\win\lib\net6.0 folder and add it to the plugin package zip file.

I ran each test in three variations of how the System.Data.ODBC.dll is published, with three System.Data.ODBC NuGet package versions and on both my Win11 and a Win2k22 system.

Each test followed these steps:
- adjust included System.Data.ODBC NuGet Package version
- clean solution
- build each solution project (order: 'ClassLibrary', 'ConsoleApp', 'MoB.ODBCNetStandardTest')
- publish WEBCON plugin package
- (optional) add System.Data.ODBC.dll to the plugin package zip file
- upload plugin package in WEBCON Designer Studio
- stop IIS app pool
- restart WEBCON Workflow Service
- start IIS app pool
- refresh WEBCON Portal site on the browser
- execute form action (global action / 'Menu button') on the browser to execute the plugin at portal (.NET runtime)
- execute form action (global action / 'On start (cyclical)') on the designer studio to execute the plugin at service (.NET Framework runtime)

The rusults in short:
Only on my local Win11 developer client System.Data.ODBC only works in version 6.0.0.0 within the service. I will post the results next (only one image allowed per post at this forum?)

In reply to: Marco Bienlein

I carried out a series of tests and documented them:

My Visual Studio solution / project structure:
- see attached Image "Project Structure - NuGet Packages.png
- there are three projects: 'ClassLibrary', 'ConsoleApp' and 'MoB.ODBCNetStandardTest'
- the target runtime of 'ClassLibrary' is '.NET Standard 2.0' and includes 'System.Data.ODBC' as a required NuGet package
- the target runtime of 'ConsoleApp' is 'NET 6.0' and includes 'ClassLibrary' as a project dependency
- 'MoB.ODBCNetStandardTest' is the plugin package project, targets to '.NET Standard 2.0', includes 'System.Data.ODBC' as a required NuGet package and has no link/dependency to the two other projects

The 'ClassLibrary' / 'ConsoleApp' construct was a hint from WEBCON support in an older support ticket for the 'System.Data.ODBC is not supported on this platform.' error (see below) occurred after changing the portal runtime in 2022.1 by WEBCON.
The trick is to take the 'System.Data.ODBC.dll' file from 'ConsoleApp'\bin\Debug\net6.0\runtimes\win\lib\net6.0 folder and add it to the plugin package zip file.

I ran each test in three variations of how the System.Data.ODBC.dll is published, with three System.Data.ODBC NuGet package versions and on both my Win11 and a Win2k22 system.

Each test followed these steps:
- adjust included System.Data.ODBC NuGet Package version
- clean solution
- build each solution project (order: 'ClassLibrary', 'ConsoleApp', 'MoB.ODBCNetStandardTest')
- publish WEBCON plugin package
- (optional) add System.Data.ODBC.dll to the plugin package zip file
- upload plugin package in WEBCON Designer Studio
- stop IIS app pool
- restart WEBCON Workflow Service
- start IIS app pool
- refresh WEBCON Portal site on the browser
- execute form action (global action / 'Menu button') on the browser to execute the plugin at portal (.NET runtime)
- execute form action (global action / 'On start (cyclical)') on the designer studio to execute the plugin at service (.NET Framework runtime)

The rusults in short:
Only on my local Win11 developer client System.Data.ODBC only works in version 6.0.0.0 within the service. I will post the results next (only one image allowed per post at this forum?)

Here is a picture of my test series...

MVP

Hi Marco,

which WEBCON BPS Version are you running? Is it using .NetCore 6 or older?

If stumbled across this one:

https://github.com/dotnet/runtime/issues/898

Fix the issue by matching the System.Data.Odbc package version relative to the dotnet version you are on. Example, if you are on .net 5, go to System.Data.Odbc package and make sure you are also on one of the versions starting with 5.


Regarding screenshots.
You can add more, when you edit the post. :)

Best regards,
Daniel