简体   繁体   English

Visual Studio不存在于命名空间中,但添加了引用

[英]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.

相关问题 Mac Visual Studio Xamarin-类型或名称空间“ Linq”在名称空间“系统”中不存在(您是否缺少程序集引用?) - Mac Visual Studio Xamarin - the type or namespace 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) Visual Studio:类型或命名空间名称“属性”不存在 - Visual Studio: Type or namespace name 'Properties' does not exist Visual Studio-WPF-添加了对DLL的引用,添加了名称空间,找不到用户控件 - Visual Studio - WPF - Added reference to DLL, Added namespace, cannot find usercontrol Visual Studio强迫我使用完整的命名空间,即使添加了引用并添加了“ using” - Visual Studio forcing me to use full namespace even with reference added and “using” added 在 Visual Studio 中查找命名空间的引用 - Find reference for namespace in Visual Studio 添加了在visual studio中未检测到的引用 - Added reference not detected in visual studio Visual Studio Online-类型或名称空间名称yyy在名称空间xxx中不存在 - Visual Studio Online - The type or namespace name yyy does not exist in the namespace xxx 命名空间'system.web'visual studio中不存在类型或命名空间名称'routing' - The type or namespace name 'routing' does not exist in the namespace 'system.web' visual studio 升级到Visual Studio 2010之后-类型或名称空间名称'xxxxxxxxx_ascx'在名称空间'ASP'中不存在 - After upgrading to Visual Studio 2010 - The type or namespace name 'xxxxxxxxx_ascx' does not exist in the namespace 'ASP' Visual Studio:名称空间“ System.Web”中不存在类型或名称空间名称“ Mvc” - Visual Studio : The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM