0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【UiPath】カレントディレクトリの違いからStudio実行かAssistant実行かを判断する

Posted at

まず前提として、UiPathでカレントディレクトリを取得したい場合はEnvironment.CurrentDirectoryを使う。

image.png

Studioから実行した場合、以下のようにMain.xamlが格納されているパスが返る。

image.png

一方、Assistant等から実行した場合、.nuget以下のパッケージされたファイルが格納されているパスが返る。

image.png

これを利用して、Environment.CurrentDirectoryから取得したパスに.nugetが含まれているかを判定することで、Studio実行かAssistant実行かをだいたい判断できる。もちろんxamlファイルを.nugetフォルダに置いて実行した場合はAssistant実行と判定されてしまう等、100%正確ではないことには留意する必要がある。

image.png

動作環境

  • UiPath.System.Activities v25.6.1
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?