An app I use interprets a .NET .config
file. I added a line specifying the path to a certificate it needs
<add key="Certificate" value="..\certificate.abc"/>
However, I found the app only works when run from the exact folder its .exe
and .config
reside. If run from another folder, it fails, because it looks for the certificate at ../
expanded relative to the working directory.
What should I write in the config file, to make sure the path is ..\certificate.abc
expanded relative to the config file rather the working directory?
I can't change the app (it's not mine), I can only change the config file.
Click the Start button and then click Computer, click to open the location of the desired file, hold down the Shift key and right-click the file. Copy As Path: Click this option to paste the full file path into a document. Properties: Click this option to immediately view the full file path (location).
A file path describes the location of a file in a web site's folder structure. File paths are used when linking to external files, like: Web pages. Images.
An absolute path always contains the root element and the complete directory list required to locate the file. For example, /home/sally/statusReport is an absolute path. All of the information needed to locate the file is contained in the path string.
By using the tilde
value="~/certificate.abc"
In visual studio 2015, the "~" keyword has no longer worked. You can now use :
value="folder\subfoler"
"folder" has the same level with .exe file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With