Access App_Data in WCF service

后端 未结 1 1957
臣服心动
臣服心动 2021-02-05 12:58

How to access App_Data folder in WCF service?

I have placed a xslt file and I am not able to find the path.

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 13:23

    You need to use HostingEnvironment.ApplicationPhysicalPath:

    string myXsltFilename = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "my.xslt");
    

    0 讨论(0)
提交回复
热议问题