Converting Custom Activitys to .Net 6.0

Hi,

I’m trying to convert our custom activitys to the new .Net6 standard but have some problems to get the activity to communicate with a MS Sqlserver?

I use Microsoft Visual Studio 2022 Pro to create and build the NuGet packages, and there are no build og version issues in VS but in UiPath Studio I get the error belov:

Unable to load DLL ‘Microsoft.Data.SqlClient.SNI.dll’: Det angivne modul blev ikke fundet. (Exception from HRESULT: 0x8007007E)

Are there others that have had the same problem?

Hi
Have you got Microsoft.Data.SqlClient in package dependencies?

Hi Heine

Did you find a solution to this problem?

I got it to work by installing the .nuget package “Microsoft.Data.SqlClient” in my project in VS2022. Then I got the file “Microsoft.Data.SqlClient.SNI.dll” from my repo under “\bin\Debug\net6.0-windows\runtimes\win-x64\native” (you want to finde the version you need ex. win-x86 ect.) and copied it to “C:\Users<username>\AppData\Local\Programs\UiPath\Studio”.

I think the best solution is to keep the Microsoft.Data.SqlClient as packagereference in Activities.Design project.

<ItemGroup>
    <PackageReference Include="Microsoft.Data.SqlClient" Version="your version" />
    <PackageReference Include="UiPath.Workflow" Version="6.0.0-20220909-01" PrivateAssets="All" />
    <PackageReference Include="System.Activities.Core.Presentation" Version="6.0.0-*" PrivateAssets="All" />
</ItemGroup>

If it still does not work, try to add PrivateAssets=“All”.

Having this solution, UiPath will try to automatically download Microsoft package when you install your custom activity nuget

1 Like