[英]Visual studio does not exist in the namespace, but reference is added
I am building a custom code coverage app using the Microsoft.VisualStudio.Coverage.Analysis class. 我正在使用Microsoft.VisualStudio.Coverage.Analysis类构建自定义代码覆盖率应用程序。 I have added the reference to the dll to my solution already and when I start typing the using statement at the top of my class Visual Studio is predicting the correct names, eg after typing "Microsoft."
我已经在我的解决方案中添加了对dll的引用,当我开始在我的类顶部键入using语句时,Visual Studio正在预测正确的名称,例如在键入“Microsoft”之后。 "VisualStudio" will be displayed in the suggestion box, the same thing happens with the next two levels, Coverage and Analysis.
“VisualStudio”将显示在建议框中,同样的事情发生在接下来的两个级别,即覆盖率和分析。 But the second I try to build the project I get the following error:
但是第二次我尝试构建项目时出现以下错误:
the type or namespace name 'visual studio' does not exist in the namespace 'microsoft' 命名空间'microsoft'中不存在类型或命名空间名称'visual studio'
I've no idea why this is happening so any suggestions would be great 我不知道为什么会这样,所以任何建议都会很棒
I should have checked the warnings in visual studio, they had the real error details, the project had to be built against .net 4.5 and not 4.0. 我应该检查visual studio中的警告,他们有真正的错误细节,项目必须针对.net 4.5而不是4.0构建。 Once this was changed the project built correctly.
一旦更改,项目就会正确构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.