LoginSignup
8
6

More than 5 years have passed since last update.

ClickOnceアプリの関連パスの取得方法

Last updated at Posted at 2018-05-10

概要

ClickOnceで配布したアプリケーションは、奥深い場所に保存されます。
そのパスをコード上から取得する方法です。

exe

場所
「C:\Users\<ユーザ名>\AppData\Local\Apps\2.0」以下のフォルダ

コード

Assembly.GetExecutingAssembly().Location

ユーザースコープのアプリケーション設定(user.config)

場所
「C:\Users\<ユーザ名>\AppData\Local\Apps\2.0\Data」以下のフォルダ

コード

ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath

データディレクトリ

場所
「C:\Users\<ユーザ名>\AppData\Local\Apps\2.0\Data」以下のフォルダ

コード

// ApplicationDeployment.IsNetworkDeployedがtrueの時に取得可能
ApplicationDeployment.CurrentDeployment.DataDirectory
8
6
1

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
8
6