【发布时间】:2016-03-14 10:52:00
【问题描述】:
我在我的 WCF 项目中引用了一个 dll,这个 dll 使用下面的代码读取一个 .xml 文件。
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), Constants.Configuration.FileConstants.AEC_XML_FILE);
当我在 IIS 中部署此 WCF 时。它在以下路径中搜索 .xml 文件 -
"C:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft Corporation\Internet Information Services\7.5.7600.16385\Calculation.xml"
它应该从 WCF 的 bin 文件夹中读取 .xml,但它正在从上面的路径中搜索 .xml。可能是什么原因?
【问题讨论】:
-
我想知道 IIS 如何引导您的 WCF 应用程序?这个引导程序可能是“入口”程序集吗?
Assembly.GetExecutingAssembly怎么样?