Visual studio does not exist in the namespace, but reference is added

4.5k views Asked by At

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, e.g. 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

1

There are 1 answers

0
Anto On BEST ANSWER

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.