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: