Issue installing custom activity created by the VS Activity Creator

I created a simple custom activity using the activity creator in visual studio and can’t seem to get it to install in UiPath. I am getting the following error:

Package ‘xxxx’ cannot be installed because it depends on package ‘System.Activities’. Studio provides its own version of the package ‘System.Activities’ and restricts its installation as a dependency.

I also uninstalled previously created custom activities and tried to reinstall them, and they are now all giving me this error even though I had already installed them before and haven’t changed them. I did upgrade to Studio 22.10.3, so I am assuming it is an issue with that. Does anyone know how I can resolve this problem?

It seems it was also posted here:

But there was no useful response.

Important to note: I am using .Net 6.0 for this.

1 Like

Are you using version 4.0 of Activity Creator and UiPath project with ‘windows’ compatibility?

Yes. I checked both to be sure.

So versions are ok.
Could you please share your code from the .Acivities.Design.scproj file? (there are your package references)

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <TargetFrameworks>net6.0-windows</TargetFrameworks>
    <UseWPF>true</UseWPF>
		<RootNamespace>DLDistanceClass.Activities.Design</RootNamespace>
		<AssemblyName>DLDistanceClass.Activities.Design</AssemblyName>
    <PackageId>DLDistanceClass.Activities</PackageId>
    <EnableDefaultPageItems>false</EnableDefaultPageItems>
  </PropertyGroup>
  <!-- Package Metadata -->
  <PropertyGroup>
    <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
    <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
    <Description>This package was generated using the UiPath VS Extension.</Description>
    <Authors>Person</Authors>
    <Company>Company</Company>
    <Copyright>© 2023 Company</Copyright>
    <PackageTags>UiPath Activit𝗒</PackageTags>
    <PackageProjectUrl>https://docs.uipath.com/integrations/docs/how-to-create-activities</PackageProjectUrl>
    <PackageIconUrl>https://raw.githubusercontent.com/NuGet/Samples/master/PackageIconNuspecExample/icon.png</PackageIconUrl>
    <!--<PackageIcon>packageIcon.png</PackageIcon>--> <!--PackageIcon not yet supported in UiPath Studio-->
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <FileVersion>1.0.0.0</FileVersion>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
    <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
  </PropertyGroup>
  <!-- Package Versions -->
  <PropertyGroup Condition="'$(Configuration)' == 'Debug' AND '$(DesignTimeBuild)' != 'true'">
    <PackageVersion>0.1.0.$([System.DateTime]::UtcNow.ToString(MMddHHmmss))</PackageVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <PackageVersion>0.1.0</PackageVersion>
  </PropertyGroup>
  <ItemGroup>
    <None Remove="Designers\CheckIsSimilarDesigner.xaml" />
  </ItemGroup>
  <!-- Package Icon -->
  <ItemGroup>
    <None Include="packageIcon.png" Pack="true" Visible="false" PackagePath="" />
  </ItemGroup>
  <Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
    <ItemGroup>
      <!--Filter out unnecessary files-->
      <_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')-&gt;WithMetadataValue('PrivateAssets', 'All'))" />
    </ItemGroup>

    <!--Print batches for debug purposes-->
    <Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" />

    <ItemGroup>
      <!--Add file to package with consideration of sub folder. If empty, the root folder is chosen.-->
      <BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)" />
    </ItemGroup>
  </Target>
  <PropertyGroup>
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <DocumentationFile>bin\$(Configuration)\DLDistanceClass.Activities.Design.xml</DocumentationFile>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.Activities.Core.Presentation" Version="6.0.0-20220831.1" />
    <PackageReference Include="System.Activities.Metadata" Version="6.0.0-20220831.1" />
    <PackageReference Include="UiPath.Workflow" Version="6.0.0-alpha-20220106-04" PrivateAssets="All" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="..\..\Shared\Themes\Generic.xaml">
      <Link>Themes\Generic.xaml</Link>
      <Generator>XamlIntelliSenseFileGenerator</Generator>
      <SubType>Designer</SubType>
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </Page>
    <Page Include="Designers\CheckIsSimilarDesigner.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </Page>
    <Page Include="Themes\Icons.xaml">
      <Generator>XamlIntelliSenseFileGenerator</Generator>
      <SubType>Designer</SubType>
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\DLDistanceClass.Activities\DLDistanceClass.Activities.csproj" PrivateAssets="All" />
  </ItemGroup>
  <ItemGroup>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Properties\Resources.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <EmbeddedResource Update="Properties\Resources.*.resx">
      <DependentUpon>Resources.resx</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
  <Import Project="..\..\Shared\UiPath.Shared.Activities.Design\UiPath.Shared.Activities.Design.projitems" Label="Shared" />
</Project>

I think it may be collision with package “System.Activities.Metadata”.
Can you remove this dependency?

I tried that, the same issue persists. It is weird that packages I have previously installed will no longer install since updating to 22.10.3. Earlier today I used the activities inside the packages in studio because I had installed them previously and I had no problems. When this new error showed up, I uninstalled the packages from studio and tried to reinstall them to see if they would also fail to install and they all failed with this error.