Converting c# library to windows compatible nuget package

Hi Team ,
Im trying to migrate a custom built c# library to be compatible with windows.
Im using VS 2022 & if I try to add to add two target versions net48 & net 6.0 windows its throwing incorrect format.

If I just built on target framework net 6.0 windows its not being compatible with windows framework.

What is the right way to do it. Do we need to get two dll’s after we build? one for net48 & one for net 6.0 windows folders?

If I point the same DLL in nuget package for both lib folders(48 & 6.0) nuget package is showing dome TMF error while creating a a package

HI,

Windows-legacy requires not 4.8 but 4.6.1.
The following document might help you.

https://docs.uipath.com/activities/other/latest/developer/migrating-activities-to-net

Regards,

But we are converting from legacy to windows right, so would need anything higher than 4.6 I guess

Hi,

Windows requires .net6 and Windows-legacy requires .net4.6.1. They are independently.

Regards,

So I tried to rebuild class library with target framework version as net 6.0 windows & built a nuget package from the dll . Even that is showing error so is it mandatory to have dll’s for both 4.8 & net 6.0?

Nope. net4.8 is not used in any UiPath platform.

If you need to create custom activity for Windows (.net6), ActivityCreator extension for VS will help you.

Regards,

So If I just change the existing C# libraries target framework to 4.6.1 … will it work or it should have both dependencies of 4.6 & .net 6-windows

Hi,

If you want to have the activities package work in both (windows and windows-legacy), it’s necessary to add both target and modify csproj file as the following document.

image

https://docs.uipath.com/activities/other/latest/developer/migrating-activities-to-net

Regards,