问题描述
我创建了一个WCF Web服务,它引用了一些类库(BO.dll,BLL.dll,DAL.dll),并调用了它们的方法。其中一个库(DAL.dll)需要一个配置文件来读取一些设置,如连接字符串。然后配置文件位于dll文件附近。但是当我使用该服务时,它有无法找到文件C:\windows \ microsoft.NET \FrameWork \v4.0.30319 \Temporary ASP.NET Files \SampleService(某些临时文件夹)的错误\ myConfigFile.config
我应该说dll代码将配置文件读作一个简单的xml文件。并提取设置。
为什么它在这个地址寻找?我应该把配置文件放在哪里才能被dll文件访问?
I have created a WCF web service which has references to some class library (BO.dll,BLL.dll,DAL.dll) ,and invoke their methods . one of the libraries(DAL.dll) need a config file to read some settings like connection string . then the config file is located near to the dll files . but when I use the service, it has error which the "could not find file C:\windows\microsoft.NET\FrameWork\v4.0.30319\Temporary ASP.NET Files\SampleService(some temp folder)\myConfigFile.config"
I should say that dll code read the config file as a simple xml file. and extract the settings.
why it looks for in this address ? where should I put the config file to be accessible by the dll file?
推荐答案
这篇关于在Web服务中引用dll配置文件时加载dll配置文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!