Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5842513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:01:39+00:00 2026-05-22T12:01:39+00:00

I have been investigating this for several hours. I have found numerous links, including

  • 0

I have been investigating this for several hours. I have found numerous links, including several here on SO which claim to show how to find the startup path, or the application directory. All of the solutions suggested return a location:

C:\Users\<my user name>\AppData\Local\Apps\2.0\XO8PWL8B.5HH\1GZX7M0H.N1J\<temp location>\

When my WPF xbap is run from a remote location. I need to determine the actual folder of the remote location.

I am deploying this to an internal server ABCDEF, so in order to run this application I am entering:

\\ABCDEF\myApp.xbap

I want to programmatically determine the server and folder. My reason for this is that each time you publish a WPF with “automatically increment revision with each publish” turned on. The folder where additional DLL’s are located changes, additional programs that this program depends on.

I want to be able to dynamically determine the correct folder to look at.

I have tried:

'Dim path As String = Reflection.Assembly.GetEntryAssembly().Location
'Dim Path As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)
'System.IO.Path.GetDirectoryName(System.Reflection. Assembly.GetExecutingAssembly.Location)
'application.StartupPath

All of which did not work.

These links suggested many of the methods I have tried:

Link1

Link2

Link3

Link4

Link5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:01:40+00:00Added an answer on May 22, 2026 at 12:01 pm

    I think this will steer you in the right direction. Since it sounds like you’re deploying via ClickOnce you should get the information you need here:

    System.Deployment.Application.ApplicationDeployment.CurrentDeployment
    

    this class can be found in the System.Deployment.dll

    Unfortunately the CurrentDeployment object doesn’t actually tell you where the application lives so you have to do some more work 🙁

    if you call this:

    var datadir = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory
    

    you’ll get something like this(for the datadirectory)

    C:\Users\Administrator\AppData\Local\Apps\2.0\Data\BVPTZA5G.3AC\WC2WBZ92.D96\ expe..tion_ba14dd6bedbd6876_0000.0009_7919ca38a4e51341\Data\1.0.0.0

    from there you need to get the folder name of the bold folder above because
    the application lives here(not the data directory):

    C:\Users\Administrator\AppData\Local\Apps\2.0\RCVHD71Y.7CQ\BC42YMHT.ZQ0\ expe..tion_ba14dd6bedbd6876_0000.0009_7919ca38a4e51341

    So I would create a function that

    • Takes in the first filepath
    • Determines the randomly generated foldername
    • finds the folder of the application based on that folder name(which contains your executables)

    I think creating an extension method on type ApplicationDeployment would be fitting.

    Hope that helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Previously I have been investigating several solutions how to register with email address instead
Have been working on this question for a couple hours and have come close
So I have been investigating this for a while and I am not sure
I am starting in node.js unit testing, and I have been investigating which was
We've been investigating this issue for a week now. We have two applications deployed
I have been investigating about creating a UDP server, at first i though i
I have been investigating OAuth to share resources in my site to other sites.
I have been investigating transactions and it appears that they take care of themselves
I have been investigating building web parts for sharepoint 2010 and currently have a
I have been looking at monotorrent and while investigating the whole bittorrent thing I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.