Web服务执行位置问题 - 找不到文件 [英] Webservice execution location problem - File not found

查看:166
本文介绍了Web服务执行位置问题 - 找不到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这是提出这个问题的正确论坛 - 如果我错了,请道歉。

我有一个名为"Transmision"的网络服务。我有一个名为SA的组件(从"Transmision"webservice调用并托管在同一个BIN文件夹中)。

当Transmission webservice调用SA组件中的方法时,我尝试加载XML文件(custom.XML)并且SA组件失败带有以下消息(所有.dll和XML文件都放在同一个BIN文件夹中)

"找不到文件"c:\ winnt \ microsoft.net \ framework \v1.1.4322 \\\ temporary asp.net files\soapservices_proxy_transmission\67c055a7\892968ec\assembly\dl2\3f0e80bb\38ba469b_ffd9c901 \ custom.XML""

"Could not find file "c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\soapservices_proxy_transmission\67c055a7\892968ec\assembly\dl2\3f0e80bb\38ba469b_ffd9c901\ custom.XML""


我在里面使用的代码加载配置文件的SA.dll是



Assembly currentAssembly = Assembly.GetAssembly(this.GetType());

string configurationFile = System.IO.Path.GetDirectoryName(currentAssembly.Location.ToString()) + @"\ custom.XML";


推荐答案

这是一个ASP.NET应用程序。你应该尝试使用HttpContext.Current.Server.MapPath。
It's an ASP.NET application. You should try using HttpContext.Current.Server.MapPath.


这篇关于Web服务执行位置问题 - 找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆