I am working on an Automation Scenario where I am downloading files from a portal and then updating Database about the count of files being downloaded. Now, when I am trying to publish it to my local system to create a NUGET file, I am getting this error : “Bad IL format. The format of the file ‘C:\Users\Username.nuget\packages\UiPath.database.activities\1.7.1\lib/net5.0-windows7.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll’ is invalid”.
Hi @dimple.khurana ,
Thanks for reaching out to UiPath Community.
Here are some steps I found which can solve the issue.
Delete the Microsoft.Data.SqlClient.SNI.dll file from the directory specified in the error message: C:\Users\Username.nuget\packages\UiPath.database.activities\1.7.1\lib/net5.0-windows7.0/runtimes/win-x64/native/.
Clear the NuGet cache by running the following command in the command prompt: nuget locals all -clear.
Re-install the UiPath.Database.Activities package by running the following command in the command prompt: nuget install UiPath.Database.Activities.
Build and publish the project again.
If you find this helpful, please mark it as a solution
Hi @dimple.khurana ,
Seems like it is partiaally cleared.
Can you try this , Open a command prompt as administrator and run the following command: nuget locals all -clear
Hi Pratik, I am also experiencing this problem and I am wanting to implement your proposed solution. I would like to know, will the command: nuget locals all -clear, mean I have to reinstall all my packages again, not just the Database one? Thanks
The nuget locals all -clear command is used to clear all cached NuGet packages, package metadata, and temporary files from the local machine. This command doesn’t uninstall or remove packages from your projects or solutions, it simply clears the local cache. When you run this command, NuGet will re-download packages and metadata the next time they are needed, but it won’t affect your installed packages in your projects. Therefore, you won’t need to reinstall all your packages or any specific package like the Database one.