开发者

The name 'xxxxx' does not exist in the current context

开发者 https://www.devze.com 2023-04-12 03:21 出处:网络
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

I've created a solution with three projects in it.

  1. Data - Class library
  2. UI - ASP.Net MVC 3 project, references the Data project, everything is fine
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消