質問する質問する
 

回答済みWCF equivalent to MapPath?

  • 2007年1月9日 16:32KevinBurton ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    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

回答

  • 2007年2月26日 16:31Wenlong Dong ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    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?

すべての返信