Odeslat dotazOdeslat dotaz
 

OdpovědětWCF equivalent to MapPath?

  • 9. ledna 2007 16:32KevinBurton Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    Is there a WCF equivalent to MapPath? I have some specific files that will be in the directory where the service is running. My question stems from the fact that MapPath bacially is called from a static HttpContext. I understand that this isn't a problem if the service is hosted in IIS but will there be an HttpContext for all hosting environments? What would be the safest way to get the "root" directory of a WCF service? Thank you.

    Kevin Burton

    HttpContext.Current.Server.MapPath

Odpovědi

  • 26. února 2007 16:31Wenlong Dong Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Kevin, using HostingEnvironment plus VirtualPathExtension is the right thing to map virtual paths to physical paths. This works fine for any IIS/WAS hosted services, even for Cassini. What other hosts are you talking about please?

Všechny reakce