|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Server.MapPathHi
we have some classes which sometimes run in a web application, and sometimes run in standalone applications. These classes have some configuration parameters, of which one is a file-path to some resources (eg. to some text files). In order to ease configuration when deployed in a web-app (especially if redeployed or if the server is altered) we use HttpContext.Current.Server.MapPath(...) but this means that the classes no longer run in a non web-application. What is a good way around this? Should be check if there is a HttpContext, and if so then "map" the path? Thanks, Peter You can get the path the exe/dlls are in with
System.AppDomain.CurrentDomain.SetupInformation.PrivateBinPath HTH Ciaran O'Donnell Show quoteHide quote "Peter Kirk" wrote: > Hi > > we have some classes which sometimes run in a web application, and sometimes > run in standalone applications. These classes have some configuration > parameters, of which one is a file-path to some resources (eg. to some text > files). > > In order to ease configuration when deployed in a web-app (especially if > redeployed or if the server is altered) we use > HttpContext.Current.Server.MapPath(...) > > but this means that the classes no longer run in a non web-application. What > is a good way around this? Should be check if there is a HttpContext, and if > so then "map" the path? > > > Thanks, > Peter > > >
Delegates for overloaded methods?
Why won't generic accept type param? VS 2005 .sln / web Solution Problem Locking memory and multiple timers? VS2005 Web Project - No DLL for Nunit about inheritance c# and MSDE Operating System and H/W for new Dev Workstation OpenFileDialog: MyComputer Debug output... |
|||||||||||||||||||||||