"Bad IL format. The format of the file 'C:\Users\username\.nuget\packages\uipath.database.activities\1.7.0\lib/net5.0-windows7.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll' is invalid"

These are not solutions to this issue. Something is wrong with UiPath.Database.Activities 1.7.1

Changing to Microsoft.Data.SqlClient is to resolve a different error message. Simply deleting and reinstalling UiPath.Database.Activities 1.7.1 doesn’t fix it.

The only “fix” I’ve found is using UiPath.Database.Activities 1.5.0

Changing to version 1.5.0 also did not help… Has anyone been able to work around this?? Thanks!

Reinstalling library UiPath.Database.Activities did not download the Microsoft.Data.SqlClient.SNI.dll so now I am having error “Failed to load library (ErrorCode: 126)”. Would you know how to solve it now?

Hi, did you manage to figure this out? I am also experiencing the same issue. Thanks

Try these:

  • Converting a project that has activities with the System.Data.SqlClient connection option from Windows - Legacy to the Windows compatibility throws an execution error unless you change the connection option to Microsoft.Data.SqlClient.
  • Similarly, converting a Windows - Legacy project that has activities with the MySql.Data.MySqlClient connection throws an error unless the connection option is set to System.Data.Odbc (the MySQL ODBC Driver needs to be installed on the machine using the Microsoft ODBC Data Source Administrator).

Reference: Activities - Release Notes

If at the runtime the error is not causing issues, the error can be skipped.