system.data.dll Error

This forum is meant for anything you would like to share with other visitors
Post Reply
User avatar
gianluca.pinoli
Posts: 36
Joined: Mon Nov 02, 2015 1:13 pm

system.data.dll Error

Post by gianluca.pinoli »

Hi to all,
I've a strange problem on a Windows 10 Build 17763.379.
Trying to connect to MySQL 5.1 using MySql.Data.dll (Framework 4.0) I have this error:

[from my error log file:]
***********************ERROR********************************
2019-30-04 11:29:42
Application: GDOfat 4.6.2l

Error Message:
Non è stato possibile caricare il file o l'assembly 'System.Data.dll' o una delle relative dipendenze. non è un'applicazione di Win32 valida. (Eccezione da HRESULT: 0x800700C1)
GDOStaticLibrary

in GDOStaticLibrary.Globals.Connetti()
in GDOfatCOM.GDOcomXML.ExportFatturaXML(String sPath, String sNomeFile, String sNrFil, String sTR, String sAnno, String sNumdoc, String sSeriedoc) in C:UsersGianlucadocumentsvisual studio 2015ProjectsGDOfatWriteXMLGDOfatCOMGDOcomXML.prg:riga 50
***********************ERROR********************************


Since this procedure is alive in ~300 installations, and was working fine also in this PC since some days ago, I deduced it was a SO problem so I tryed to update the system, and the error now is:


***********************ERROR********************************
2019-30-04 16:03:24
Application: GDOfat 4.6.2l

Error Message:
Non è stato possibile caricare il file o l'assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' o una delle relative dipendenze. Firma del metodo con convenzione di chiamata non valida. (Eccezione da HRESULT: 0x80131239)
GDOStaticLibrary

in GDOStaticLibrary.Globals.Connetti()
in GDOfatCOM.GDOcomXML.ExportFatturaXML(String sPath, String sNomeFile, String sNrFil, String sTR, String sAnno, String sNumdoc, String sSeriedoc) in C:UsersGianlucadocumentsvisual studio 2015ProjectsGDOfatWriteXMLGDOfatCOMGDOcomXML.prg:riga 50

Error Message:
Firma del metodo con convenzione di chiamata non valida. (Eccezione da HRESULT: 0x80131239)
***********************ERROR********************************


I've also tryed to:
1) Uninstall/Reinstall Frameword 4.7
2) Run NetFxRepairTool.exe
But the error still remain.

Anyone have an idea how to fix this problem without reinstall the SO?

I was forgetting to include the connection method:

PUBLIC static METHOD Connetti() AS LOGIC
LOCAL lResult := TRUE AS LOGIC

sConnectionString := i"server={sServer}; port={sPort}; user id={sUser}; password={sPwd}; database={sDatabase};pooling=false"
Globals.oConn := MySql.Data.MySqlClient.MySqlConnection{sConnectionString}
TRY
oConn:Open()
CATCH ex AS MySqlException
WriteLog("oConn: Error connecting to the server: " + ex:Message)
lResult := FALSE
END TRY
return lResult




Regards
Gianluca Pinoli
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

system.data.dll Error

Post by Jamal »

Hi Gianluca,

You probably have a mismatch of assemblies. Check the application Target and select x86 if you need 32bit assemblies and 64bit if you want to target 64bit. If you select Any CPU, both 32bit and 64bit assemblies must be installed in the GAC for each platform or the application path.

Also, I noticed Visual Studio 2015 mentioned in the error message! Are you using VS 2017.

HTH,
Jamal
User avatar
gianluca.pinoli
Posts: 36
Joined: Mon Nov 02, 2015 1:13 pm

system.data.dll Error

Post by gianluca.pinoli »

Hi Jamal,
I'm still using VS2015.
All my applications are x86

Regards
Gianluca
User avatar
gianluca.pinoli
Posts: 36
Joined: Mon Nov 02, 2015 1:13 pm

system.data.dll Error

Post by gianluca.pinoli »

Hi Again,
we found out it was a OS problem.
Another software give the same error (see attached image)
rossi giuseppe error framework.png
rossi giuseppe error framework.png (32.02 KiB) Viewed 243 times
I know this is not the right forum, but if anyone have a clue it would be very helpful…

Regards
Gianluca
FoxProMatt

system.data.dll Error

Post by FoxProMatt »

Moderators should now move this message out of the "Product" forum, because it is now off-topic, since it is not related to any X# issues.
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

system.data.dll Error

Post by Jamal »

Probably better create another forum section called: .NET Framework and another for .NET Core.
Post Reply