The name 'xxxxx' does not exist in the current context
I've created a solution with three projects in it.
- Data - Class library
- UI - ASP.Net MVC 3 project, references the Data project, everything is fine
- UnitTest - Console App, added reference for the Data project, get context error.
I'm sitting here scratching my head trying to figure out if I'm running into a VS bug or I've done something completely boneheaded. Either way开发者_StackOverflow中文版 I can't figure out why after adding a reference to the data project I can't reference it. My confusion is further compounded by the fact that directly after adding the reference for the Data project to the UnitTest project but before building the solution Intellisense picks up the Data project namespaces just fine.
Help!
I finally took a look at the Project Properties of the UnitTest project and noticed that under the Application tab the Target Framework had defaulted to .Net Framework 4 Client Profile. Once I switched it to .Net Framework 4 everything worked as expected. Seems like the kind of thing the compiler might be able to hint at but what do I know.
精彩评论