P
Peter Kirk
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
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