简体   繁体   中英

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. 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." "VisualStudio" will be displayed in the suggestion box, the same thing happens with the next two levels, Coverage and Analysis. 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'

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. Once this was changed the project built correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM