Is it possible to specify a path that is relative to the root of both a console and an asp.net webapplication? So
- For the Console Application, it should be relative to the .exe file
- For the ASP.NET Webapplication, it should be relative to the root Web.Config
Example: Let's say I have a file called "log.txt". I have a logging component in a separate dll, that uses this log.txt under "logs" folder. I have two applications that use this component, one is a Console Application, the other one is an ASP.NET Web Application.
Is it possible to specify a relative path in the logging component, that will find the file at the following places?:
mywebapp/
-Web.Config
-bin/logging.dll
-other web files
-logs/log.txt
myconsoleapp/
-myconsoleapp.exe
-logging.dll
-some other dlls
-logs/log.txt