VS2010 上的 Microsoft.VisualStudio.TestTools.UnitTesting 命名空间在哪里? [英] Where is the Microsoft.VisualStudio.TestTools.UnitTesting namespace on VS2010?

查看:61
本文介绍了VS2010 上的 Microsoft.VisualStudio.TestTools.UnitTesting 命名空间在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将包含一些单元测试项目的 VS2008 解决方案转换为 VS2010.转换后,我尝试编译解决方案,但出现以下错误:

I converted a VS2008 solution that contains some unit testing projects to VS2010. After the conversion I tried to compile the solution, but I'm getting the following error:

命名空间Microsoft"中不存在类型或命名空间名称VisualStudio"(您是否缺少程序集引用?)

The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

无法找到命名空间声明using Microsoft.VisualStudio.TestTools.UnitTesting;.此外,我在尝试添加新项目引用时找不到 Microsoft.VisualStudio.QualityTools.UnitTestFramework 程序集.

The namespace declaration cannot be found using Microsoft.VisualStudio.TestTools.UnitTesting;. In addition, I couldn't find the Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly when I tried to add a new project reference.

有人知道我做错了什么吗?

Does anyone know what I'm doing wrong?

推荐答案

我刚刚也遇到了这个问题,还有一个 Microsoft.Data.Schema 库.答案是正确的,因为这些库在机器上并且在 VS 10.0 目录中.

I just had this problem as well, and with a Microsoft.Data.Schema library as well. The answer is correct, in that these library are on the machine and in the VS 10.0 directory.

问题(至少对我而言)是解决方案是从 VS2008 转换而来的,并且转换实用程序针对 .NET 3.5 的项目.由于 10.0 库需要 .NET 4.0,因此编译器不会选择它们.

The problem (at least for me) was that the solution was converted from VS2008 and the conversion utility targetted the project for .NET 3.5. Since the 10.0 library require .NET 4.0 they are not picked up by the compiler.

解决方案是在正确解析的情况下恢复使用 VS2008;或者将项目切换为针对 .NET 4.0 进行编译,以便您可以使用可用的库.

The solution is to either revert to use VS2008 where these resolve correctly; or to switch the project to compile for .NET 4.0 so you can use the available libraries.

这篇关于VS2010 上的 Microsoft.VisualStudio.TestTools.UnitTesting 命名空间在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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