This seems to be a common problem where a reference to another project has a yellow triangle on it. Like this:
Check your warnings:
In my case the project targeted had a .NET library set to 4.5 and my main project had a .NET of 3.5. The warning, however, gives all the details needed:
For me, the project in question was created with .NET 4.5 automatically, so I had no idea what was going on when I ran into this original problem. To fix it, right click on the project and select properties:
Then change the “.NET Framework” dropdown to the same version as all other projects. You’ll be presented with a warning that the current project should be closed and re-opened after changing. Click the “Yes” and continue. Then close and re-open your solution.
Thanks, this solved my issue
Me too 😀
Thanks, this was driving me crazy!
That's why I did a blog post for this… I wasted an hour trying to figure out what was going on.
Same thing happened to me just now and it was this exact problem. And now I know to look for the warnings! Cheers.
That was the problem, thank you!
Thanks Frank that triangle may just have well said F off for all the good it did.
Mine was wrong frameworks too, thanks from Donkey Brains.
This was my problem in a Sql Server db project! I changed the target version after I had added db references to the system databases. Thanks a million