IoC配置不适用于“测试单位"项目 [英] IoC configuration don't work into a Testing Unit project

查看:137
本文介绍了IoC配置不适用于“测试单位"项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用带有专用配置文件(Unity.config)的IoC,
普通项目一切正常,但是在测试单元项目的情况下,IoC无法加载此文件,我使用此属性

Hi,

I''m using IoC with dedicated configuaration file(Unity.config),
all things went good with ordinary project, but IoC fail loading this file inthe case of a Testing Unit project, I use this attribut

[DeploymentItem("unity.config"), TestMethod]

导入文件,但是IoC无法解析别名,
有帮助吗?

谢谢,

to import the file, but IoC fail resolving alias,
Some help ?

thanks,

推荐答案

请确保您的unity.config位于您的某个位置测试项目,并确保将unity.config属性中的复制到输出目录"设置为始终"
Make sure your unity.config is somewhere in your test project and make sure the Copy To Output Directory in the properties of unity.config is set to "Always"


这篇关于IoC配置不适用于“测试单位"项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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