Poser une questionPoser une question
 

TraitéeWCF equivalent to MapPath?

  • mardi 9 janvier 2007 16:32KevinBurton Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    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

Réponses

  • lundi 26 février 2007 16:31Wenlong Dong Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    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?

Toutes les réponses