Folks,
I have an ASP .Net web service that I am using for a product in work. But we need to make this a more "portable" for installation on other boxes. One of the requirements is to avoid a recompile when performing different installs. Thus we can't have any hard coded paths in the service.
So I have some code I wrote for another application that happily parses an xml file and stores a load of local variables based on it's content, which should be sufficient... however the service doesn't seem to run from the same place each time, from what I gather the code is kept in a .dll file which is moved to a temporary directory on the server when the service is started, and is random each time.
What I want to know is, is it possible for a web service to be aware of the file path that the web site it is running in in IIS allowing us to reference it no matter where it is installed (Like Application.StartupPath in a normal app)? OR if that is not possible is it possible in either Visual Studio or IIS to ensure that the xml file is copied across to the temp directory each time, and then user a local path (again something like Application.StartupPath) that will return the current temp directory to reference it... i.e. Application.StartupPath + @"\Settings.xml";
Any help here would be greatly appreciated, thanks for you time folks!
Mark
EDIT: The "random" directory the files are being run from is like this (but different) every time...
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\root\be744616\404c35e0\assembly\dl3\6bb73064 \0006a6c3_7987c901