Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从WCF的子目录加载xml文件?_Wcf_C# 4.0 - Fatal编程技术网

如何从WCF的子目录加载xml文件?

如何从WCF的子目录加载xml文件?,wcf,c#-4.0,Wcf,C# 4.0,在我的WCF类库中,我需要从子目录加载包含一些数据的XML文件 Example /doc/file.xml 我无法映射路径,因为HttpContext.Current始终为空 加载xml文件的正确方法是什么?您可以打开ASP.NET Compability模式,以便从WCF访问ASP.NET管道(HttpContext.Current等) 看 --larsw为什么不使用绝对路径?

在我的WCF类库中,我需要从子目录加载包含一些数据的XML文件

Example

/doc/file.xml
我无法映射路径,因为HttpContext.Current始终为空


加载xml文件的正确方法是什么?

您可以打开ASP.NET Compability模式,以便从WCF访问ASP.NET管道(HttpContext.Current等)


--larsw

为什么不使用绝对路径?