从测试项目的类中(例如,使用nunit)调用读取了app.config的项目的类函数

编程入门 行业动态 更新时间:2024-10-27 06:27:24
本文介绍了从测试项目的类中(例如,使用nunit)调用读取了app.config的项目的类函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我从项目中读取app.config时,将找到app.config部分. 但是,当我从另一个项目(显然是在另一个名称空间中)调用此功能时,例如使用nunit,则找不到该部分. 我想念她什么? 问候 古托姆·哈弗森 克里斯蒂安桑 挪威

When I read app.config from within the project, the app.config section is found. But when I call on this functionality from another project (in another namespace obviously) eg using nunit, the section is not found. What am I am missing her ? Regards Guttorm Haaversen Kristiansand Norway

推荐答案

难怪,因为这是一个不同的过程-不同的入口程序集; app.config已为每个应用程序创建和使用. (顺便说一下,名称空间并不重要.) No wonder, because this is a different process -- different entry assembly; app.config is created and used per application. (Name spaces don''t matter, by the way.)

更多推荐

从测试项目的类中(例如,使用nunit)调用读取了app.config的项目的类函数

本文发布于:2023-11-04 17:30:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1558565.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   函数   类中   测试   nunit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!