调用WCF服务时出现异常错误



我有一个使用WCF服务的网站(客户端)。

当我用调试器运行网站时,异常错误返回:

ex        {"Could not find a part of the path 'E:\ORG_FILES\Logs\P_Log.txt'."}      System.Exception {System.ServiceModel.FaultException<System.ServiceModel.ExceptionDetail>} 

在web服务中我没有double :

String logPath = @"E:/ORG_FILES/Logs/P_Log.txt"

出现此错误的原因有以下两种:
1。路径不正确
运行应用程序的帐户没有在路径位置创建目录的权限,例如,如果您试图在共享驱动器上创建目录,但没有足够的权限等。
您可以尝试更改logPath:

string  logPath = @"E:ORG_FILESLogsP_Log.txt";


string logPath = "E:\ORG_FILES\Logs\P_Log.txt";

最新更新