尝试在测试项目中使用IValueconverter时出错 [英] Getting error while trying to use IValueconverter in test project

查看:78
本文介绍了尝试在测试项目中使用IValueconverter时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows Phone 8项目和一个测试项目.在我的Windows Phone项目中,我有一个名为BoolToIntConverter的转换器类,该类继承了IValueConverter.现在,我需要编写一个测试方法来测试BoolToIntConverter的convert方法. 但是在我的测试项目中,当我创建BoolToIntConverter的对象时,它向我抛出了一个构建错误,提示说: 您必须添加对程序集"system.windows"的引用,版本= 2.0,6.0

I have one windows phone 8 project and a test project .In my windows phone project I am having a converter class named BoolToIntConverter which inherits the IValueConverter. Now I need to write a test method for testing the convert method of BoolToIntConverter. But in my test project while I am creating an object of the BoolToIntConverter ,it is throwing me an build error saying  "you must add a reference to assembly "system.windows" version =2.0,6.0

如何解决这个问题.

推荐答案

您是否已编辑测试项目参考,并在程序集"中搜索"system.windows" ;,然后选中该框并应用?您的测试项目必须具有与测试项目相同的参考(实际上是每个有效使用的参考),此外 一些专用于测试的软件.
Did you edit the test projet reference and in "assemblies", search for "system.windows", then check the box and apply? Your test project must have the same references as you tested project (in fact every effectively used ones), plus some ones dedicated to testing.


这篇关于尝试在测试项目中使用IValueconverter时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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