类库可以读取正在执行的编码 UI 测试的 app.config 文件吗?
我开发了一个小型实用程序库,用于处理我的所有编码 UI 测试项目所需的大量配置和日志记录。我将类库设置为使用以下内容读取 app.config 文件来读取值:
ConfigurationManager.AppSettings["KeyName"]
我知道,当您在另一个项目中包含此类库时,应在执行期间使用新项目的 app.config。事实上,这正是我想要的,只是它似乎没有发生。
我的另一个项目是 CUIT,但它包含的类库似乎没有读取任何类型的 app.config。不是它自己的,也不是 CUIT 的。
这可能吗?
I've developed a little utility library that deals with a lot of the configuration and logging needed to by all of my Coded UI test projects. I have the class library set up to read the app.config file using the following to read the values:
ConfigurationManager.AppSettings["KeyName"]
I understand that when you include this class library in another project, the app.config of the new project should be used during execution. Actually, that's precisely what I want, it just doesn't appear to be happening.
My other project is a CUIT but it seems as though my class library it includes isn't reading any sort of app.config. Not its own, not the CUIT's.
Is this even possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来我在类库中缺少以下行。添加后,一切都按我的预期进行。
Looks like I was missing the following line in my class library. After adding it things worked as I expected.