UiPath Documentation
marketplace
latest
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

Marketplace ユーザー ガイド

最終更新日時 2026年5月5日

Building Activity Packages

UiPath のプラットフォームは .NET Framework 上に構築されているため、すべてのアクティビティは Nuget パッケージ の形式を取ります (この .nupkgGo!Marketplace または UiPath Studio の パッケージ マネージャーのフィードから)。ファイルを 1 つの Nuget パッケージにバンドルするには、次の 4 種類のファイルが必要です。

AssemblyInfo ファイル

Visual Studio 内にプロジェクトを構築すると、そのプロジェクトのコードが Microsoft Build Engine (別名: MSBuild) によって、他の Windows アプリケーションで使用できる ライブラリである DLL に変換されます。このライブラリのメタデータは、プロジェクトの [プロパティ] セクション内に格納されている 3 つの AssemblyInfo ファイルから取得されたものです。このファイルは、さまざまなレベルのアクティビティ セットに対する情報を提供します。それぞれを見てみましょう。

1. AssemblyInfo.cs

[assembly: AssemblyTitle("MyCompany.MyProduct.Activities")]
[assembly: AssemblyDescription("This activity was made using the UiPath Activity Set extension.")]
[assembly: ComVisible(false)]
[assembly: Guid("133E5191-68DA-4F05-9A81-D5CFA16525C8")]
[assembly: AssemblyTitle("MyCompany.MyProduct.Activities")]
[assembly: AssemblyDescription("This activity was made using the UiPath Activity Set extension.")]
[assembly: ComVisible(false)]
[assembly: Guid("133E5191-68DA-4F05-9A81-D5CFA16525C8")]

AssemblyInfo.cs には、特定のプロジェクト (例: MyCompany.MyProduct) に固有のメタデータが含まれています。

  • AssemblyTitle は、DLL のフレンドリー名を指定します。わかりやすくするために、プロジェクトの名前と一致させます。
  • AssemblyDescription は、アセンブリの特徴と目的を簡単にまとめたものです。 他のいくつかの属性 (言語設定やバージョン番号など) を含めることができます。アセンブリのすべての属性のリストについては、Microsoft の公式ドキュメントをご覧ください。
  • ComVisibleGuid は、このプロジェクトの最終的なライブラリを参照するアプリケーションによって使用される既定の属性です。ほとんどのアクティビティでは手つかずのままですが、その効果について詳しくは こちらをご覧ください

2. MyCompany.MyProductAssemblyInfo.cs

#i DEBUG
[assembly: AssemblyVersion("1.0.*")]
#els
[assembly: AssemblyVersion("1.0.0")]
#endi
#i DEBUG
[assembly: AssemblyVersion("1.0.*")]
#els
[assembly: AssemblyVersion("1.0.0")]
#endi

次のアセンブリ ファイル AssemblyInfo.cs には、アクティビティ セット全体に固有でありながら、すべてのプロジェクト間で共有されるメタデータが含まれています。この場合は、アクティビティのバージョンのみ)。バージョンは、Visual Studio の構成ごとに異なることに注意してください。

  • デバッグ: Visual Studio がデバッグ モードの場合、アクティビティはバージョン番号 1.0.* でビルドされます。つまり、メジャー バージョンとマイナー バージョンが設定され (1.0)、ビルドごとにパッチ バージョンが増分されます。これは、同じコードに何度も変更を加える場合に役立ちます。後続のパッケージがそれぞれ新しいバージョンでビルドされても、簡単に区別できるからです。

  • リリース: Visual Studio がリリース モードの場合、バージョン番号が設定されます (例: 1.0.0)。これにより、パッケージの公式リリースの時期を完全に管理できるようになります。

3. GlobalAssemblyInfo.cs

[assembly: AssemblyCompany("MyCompany")]
[assembly: AssemblyProduct("Product A")]
[assembly: AssemblyCopyright("MyCompany © 2019")]
[assembly: AssemblyTrademark("MyCompany™")]
[assembly: AssemblyCulture("en-CA")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyCompany("MyCompany")]
[assembly: AssemblyProduct("Product A")]
[assembly: AssemblyCopyright("MyCompany © 2019")]
[assembly: AssemblyTrademark("MyCompany™")]
[assembly: AssemblyCulture("en-CA")]
[assembly: NeutralResourcesLanguage("en-US")]

GlobalAssemblyInfo.csには、作成するすべてのアクティビティ セット間で共有されるメタデータが含まれます。たとえば、 UiPath.GSuite.Activities パッケージと UiPath.MicrosoftOffice365.Activities パッケージは、同じ 会社 (UiPath) によって作成され、同じ 製品 (UiPath Studio) を対象とし、同じ 著作権商標言語情報を持っているため、不必要な重複を避けるために同じ GlobalAssemblyInfo.cs ファイルを使用しています。

Nuspec

すべてのプロジェクトが DLL にコンパイルされると、これらのライブラリは UiPath Studio で使用可能な Nuget パッケージにバンドルされます。このパッケージのメタデータは、デザイン プロジェクト内の nuspec ファイルから取得されたものです。

nuspec を介して利用可能なメタデータ要素の完全なリストはこちらで確認できますが、まずは以下に示す基本的な例を見てみましょう。これらの要素は、UiPath Studio のパッケージ マネージャーに表示されるフィールドに対応しており、ユーザーはアクティビティ セットを見つけて区別することができます。

一部の要素 (IDバージョンなど) には、$element$ の形式のタグが含まれています。これらのタグは AssemblyInfo ファイル内の対応するタグから値を取得しており、情報の重複を回避しています。

<?xml version="1.0"?>
<package>
  <metadata>
    <id>$title$</id>
    <version>$version$</version>
    <title>$title$</title>
    <authors>$author$</authors>
    <owners>$author$</owners>
    <description>$description$</description>
    <copyright>$copyright$</copyright>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
    <projectUrl>https://integrations.uipath.com/docs/integrating-with-uipath</projectUrl>
    <iconUrl>https://raw.githubusercontent.com/NuGet/Samples/master/PackageIconNuspecExample/icon.png</iconUrl>
    <tags>UiPath Activities</tags>
    <dependencies>
    </dependencies>
  </metadata>
  <files>
    <file src="$OutputPath$**\)\)MyCompany.MyProduct*resources.dll" target="lib\)
et461"/>
  </files>
</package>
<?xml version="1.0"?>
<package>
  <metadata>
    <id>$title$</id>
    <version>$version$</version>
    <title>$title$</title>
    <authors>$author$</authors>
    <owners>$author$</owners>
    <description>$description$</description>
    <copyright>$copyright$</copyright>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
    <projectUrl>https://integrations.uipath.com/docs/integrating-with-uipath</projectUrl>
    <iconUrl>https://raw.githubusercontent.com/NuGet/Samples/master/PackageIconNuspecExample/icon.png</iconUrl>
    <tags>UiPath Activities</tags>
    <dependencies>
    </dependencies>
  </metadata>
  <files>
    <file src="$OutputPath$**\)\)MyCompany.MyProduct*resources.dll" target="lib\)
et461"/>
  </files>
</package>

注:

Visual Studio に精通している場合は、実際に AssemblyInfo ファイルと MSBuild だけを使用して独自に Nuget パッケージを構築できます。では、それとは別に nuspec ファイルを使用するのはなぜでしょう。パッケージの所有者ファイルやローカリゼーション ファイルなどの特定のメタデータ プロパティは nuspec でのみ使用可能です。nuspec が必要なのはそのためです。

デザイナー メタデータ

アクティビティが作成され、デザイナー (UI 要素) がビルドされた後、それらのアクティビティとデザイナーは、UiPath Studio の [アクティビティ] パネルに表示されるようリンクされ、メタデータ ストアに登録される必要があります。以下のコードを使用し、2 つのアクティビティ (親スコープと子アクティビティ) のそれぞれについて次の情報を登録することによって、それらのアクティビティが作成されます。

  • カテゴリ: これらのアクティビティが表示される [アクティビティ] ペインのセクションです。既定では、*MyCompany > MyProduct に設定されています

  • Resources.resx の Category 属性を変更することで変更できます。12 行目で、アクティビティ プロジェクトのクラスが 10 行目で指定されたカテゴリにどのようにリンクされているかを確認します。

  • デザイナー: 対象のアクティビティの UI。13 行目で、アクティビティ プロジェクトからのクラスとデザイン プロジェクトからのクラスがどのようにリンクされているのかを確認します。

  • ドキュメント: アクティビティのオンライン ドキュメント。いずれかの UiPath ワークフローで任意のアクティビティを選択して F1 キーを押すと、そのアクティビティのヘルプ ドキュメントが既定のブラウザーで開きます。このドキュメントの URL は、ここで 14 行目 (*go.uipath.com のように指定されています。

  • がプレースホルダーとして使用されます)。

    namespace MyCompany.MyProduct.Activities.Design
    {
        public class DesignerMetadata : IRegisterMetadata
        {
            public void Register()
            {
                var builder = new AttributeTableBuilder();
                builder.ValidateTable();
                var categoryAttribute =  new CategoryAttribute($"{Resources.Category}");
                builder.AddCustomAttributes(typeof(ParentScope), categoryAttribute);
                builder.AddCustomAttributes(typeof(ParentScope), new DesignerAttribute(typeof(ParentScopeDesigner)));
                builder.AddCustomAttributes(typeof(ParentScope), new HelpKeywordAttribute("https://go.uipath.com"));
                builder.AddCustomAttributes(typeof(ChildActivity), categoryAttribute);
                builder.AddCustomAttributes(typeof(ChildActivity), new DesignerAttribute(typeof(ChildActivityDesigner)));
                builder.AddCustomAttributes(typeof(ChildActivity), new HelpKeywordAttribute("https://go.uipath.com"));
                MetadataStore.AddAttributeTable(builder.CreateTable());
            }
        }
    }
    namespace MyCompany.MyProduct.Activities.Design
    {
        public class DesignerMetadata : IRegisterMetadata
        {
            public void Register()
            {
                var builder = new AttributeTableBuilder();
                builder.ValidateTable();
                var categoryAttribute =  new CategoryAttribute($"{Resources.Category}");
                builder.AddCustomAttributes(typeof(ParentScope), categoryAttribute);
                builder.AddCustomAttributes(typeof(ParentScope), new DesignerAttribute(typeof(ParentScopeDesigner)));
                builder.AddCustomAttributes(typeof(ParentScope), new HelpKeywordAttribute("https://go.uipath.com"));
                builder.AddCustomAttributes(typeof(ChildActivity), categoryAttribute);
                builder.AddCustomAttributes(typeof(ChildActivity), new DesignerAttribute(typeof(ChildActivityDesigner)));
                builder.AddCustomAttributes(typeof(ChildActivity), new HelpKeywordAttribute("https://go.uipath.com"));
                MetadataStore.AddAttributeTable(builder.CreateTable());
            }
        }
    }
    

アクティビティ セットをビルドする

前述のファイルが完成したら、アクティビティ セットのビルドは簡単です。[ソリューション エクスプローラー] 内でソリューションを右クリックし、[リビルド] を選択します。

出力パネルに、3 つのプロジェクトすべてのビルドが完了したことを示すメッセージと、バンドルされた nupkg ファイルへのパスが表示されます。

注:

アクティビティ パッケージをビルドするには、 MyCompany.MyProduct フォルダーまたは MyCompany.MyProduct.Activities.Design プロジェクトを右クリックして「再構築」することもできます。それはなぜか。ビルド後のスクリプトに関する次のセクションを参照してください。

ビルド後のスクリプト

デザイン プロジェクトの [プロパティ] > [ビルド イベント] に移動すると、ビルド後のスクリプトがあります。このスクリプトは、すべてのプロジェクトがビルドされた直後に実行されます。

このスクリプトの最初の行では、混乱を避けるために、出力ディレクトリに存在するパッケージの古いバージョンが削除されます。

2 行目では NuGet のコマンド ライン ツール (nuget.exe) を使用して 3 つのプロジェクトの DLL が 1 つの nuget パッケージに統合されます。このパッケージは UiPath Studio で読み取り可能です。

if exist $(TargetDir)Packages\)\)MyCompany.MyProduct*.* del $(TargetDir)Packages\)\)MyCompany.MyProduct*.*
if $(ConfigurationName) == Debug "$(SolutionDir).nuget\)\)NuGet.exe" pack "$(ProjectPath)" -OutputDirectory "Packages" -IncludeReferencedProjects -Prop Configuration=$(ConfigurationName)
if exist $(TargetDir)Packages\)\)MyCompany.MyProduct*.* del $(TargetDir)Packages\)\)MyCompany.MyProduct*.*
if $(ConfigurationName) == Debug "$(SolutionDir).nuget\)\)NuGet.exe" pack "$(ProjectPath)" -OutputDirectory "Packages" -IncludeReferencedProjects -Prop Configuration=$(ConfigurationName)

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得