- Overview
- Custom activities
- Migrating Activities to .NET 6
- Release Notes
- Building Workflow Analyzer Rules
- Building Activities Project Settings
- Creating Custom Wizards
- Prioritize Activities by Scope
- UiPath.Activities.Api.Base
- UiPath.Studio.Activities.Api
- UiPath.Studio.Activities.Api.Activities
- UiPath.Studio.Activities.Api.BusyService
- UiPath.Studio.Activities.Api.ExpressionEditor
- UiPath.Studio.Activities.Api.Expressions
- UiPath.Studio.Activities.Api.Licensing
- UiPath.Studio.Activities.Api.Mocking
- UiPath.Studio.Activities.Api.ObjectLibrary
- UiPath.Studio.Activities.Api.PackageBindings
- UiPath.Studio.Activities.Api.ProjectProperties
- UiPath.Studio.Activities.Api.ScopedActivities
- UiPath.Studio.Activities.Api.Settings
- UiPath.Studio.Activities.Api.Wizards
- UiPath.Studio.Activities.Api.Workflow
- UiPath.Studio.Api.Controls
- UiPath.Studio.Api.Telemetry
- UiPath.Studio.Api.Theme
- Robot JavaScript SDK
- Triggers SDK
Developer Guide
Migrating Activities to .NET 6
This page offers an overview of how to migrate your custom .NET Framework activities to .NET 6 for use in projects with the Windows compatibility available starting with Studio 2021.10.6.
We will use the sample MathSquareOfSum .NET Framework activity documented on the Creating Activities With Code (Legacy) page as an example for a migration to .NET 6 that targets Windows while also maintaining compatibility with .NET Framework for Windows - Legacy projects.
A project that is using the .NET Framework project format must be migrated to the new SDK-style format. For more information, see the Microsoft documentation. Package references must be declared in the .csproj file as opposed to packages.config.
- In Solution Explorer, right click the project and select Unload Project.
- Copy references and clear everything from the
.csproj
file. - Manually update the
.csproj
file to the new format. - Add the target framework net6.0-windows.
- Mark the original references as net461 only by adding a condition.
- Add a new reference section with conditions for net6.0-windows. You must declare the following WWF dependencies for .NET: UiPath.Workflow.Runtime, UiPath.Workflow, System.Activities.Core.Presentation, System.Activities.Metadata. Make sure all your dependencies support .NET. You might need to find newer package versions or replacement packages.
- In Solution Explorer, right click the project and select Reload Project.
The file should look as follows.
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" ToolsVersion="Current">
<PropertyGroup>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<AssemblyName>MathSquareOfSum</AssemblyName>
<RootNamespace>MathSquareOfSum</RootNamespace>
<UseWpf>true</UseWpf>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Activities" />
<Reference Include="System.Activities.Core.Presentation" />
<Reference Include="System.Activities.Presentation" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<PackageReference Include="UiPath.Workflow.Runtime" Version="6.0.0-20220401-03" PrivateAssets="All" />
<PackageReference Include="UiPath.Workflow" Version="6.0.0-20220401-03" PrivateAssets="All" />
<PackageReference Include="System.Activities.Core.Presentation" Version="6.0.0-20220318.2" PrivateAssets="All" />
<PackageReference Include="System.Activities.Metadata" Version="6.0.0-20220318.2" PrivateAssets="All" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" ToolsVersion="Current">
<PropertyGroup>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<AssemblyName>MathSquareOfSum</AssemblyName>
<RootNamespace>MathSquareOfSum</RootNamespace>
<UseWpf>true</UseWpf>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Activities" />
<Reference Include="System.Activities.Core.Presentation" />
<Reference Include="System.Activities.Presentation" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<PackageReference Include="UiPath.Workflow.Runtime" Version="6.0.0-20220401-03" PrivateAssets="All" />
<PackageReference Include="UiPath.Workflow" Version="6.0.0-20220401-03" PrivateAssets="All" />
<PackageReference Include="System.Activities.Core.Presentation" Version="6.0.0-20220318.2" PrivateAssets="All" />
<PackageReference Include="System.Activities.Metadata" Version="6.0.0-20220318.2" PrivateAssets="All" />
</ItemGroup>
</Project>
.cs
file for each target for missing references and update the references in the .csproj
file if needed.
Make sure you test the project for errors before attempting to build it.
%UserProfile%\source\repos\MathSquareOfSum\MathSquareOfSum\bin\Debug
Create a NuGet package using NuGet Package Explorer, as described in Creating Activities With Code (Legacy).
- Launch NuGet Package Explorer and click Create a new package (Ctrl + N). A split-window is displayed which shows Package metadata and Package contents. We need to add all dependencies in the latter section.
- Right-click inside the Package contents section. A context menu is displayed.
- Click Add lib folder. Notice a new lib item is created in the Package contents section.
- Right-click lib twice and select as follows:
- Add .NET Framework folder > v4.6.1
- Add .NET folder > v6.0-windows
- Right-click each of the folders added in the previous step and select Add Existing File to load the external assembly (
.dll
) files required for each one. The files are located in a subfolder with the framework name located in the\bin\Debug
folder:- net461 - MathSquareOfSum.dll
- net6.0-windows - MathSquareOfSum.dll
- Rename the folder net6.0-windows to
net6.0-windows7.0
. - With the file selected, access the Edit menu and select Edit Metadata. The left panel is now fitted with editable metadata fields.
- Edit the metadata fields as needed.
- Select Edit dependencies, and then add the following target frameworks: net461 and net6.0-windows7.0.
- Click the green check mark button in the top-left corner save all changes.
- Select File > Save As to save the new file.