Debugging what I think is a bogus VS2010 error (missing assembly reference)
I've done this hundreds of times before without issue, but today I've got a project that just won't cooperate in VS2010.
I have a plugin and need to test it. So I wrote a test application that will host my plugin. Whenever I do this, I just add a reference to the plugin, then declare it in my code. Since the test app doesn't have the using statement added by default, I hover over the type and press Shift-Alt-F10 and hit enter to automatically generate the using statement. I've never had this fail until today.
The problem I have is that the first time I do it, it adds the statement fine, but the开发者_C百科n when I compile I get the error:
The type of namespace name 'Company' could not be found (are you missing a using directive or an assembly reference?).
No, I'm not. It's right there and there. But now my plugin is underlined in red as if there's a problem.
If I close VS2010 and reopen the project, it opens and the plugin's type is correctly highlighted in blue. But when I compile, I get the error again and then get the red underlining again.
This is totally driving me batty. I'm hoping that someone has seen this before, or can point out what stupid thing I'm doing wrong!
Crap. I decided to look into the test app project properties, and set my .NET target framework to 4.0 instead of 4.0 CP. That fixed my problem. Argh!
精彩评论