Referenced Project gets “lost” at Compile Time

后端 未结 2 822
失恋的感觉
失恋的感觉 2020-11-29 20:16

I have a C# solution with two projects: a service (the main project) and a logger. The service uses classes from the logger. I\'ve added a Reference to the logger project wi

2条回答
  •  被撕碎了的回忆
    2020-11-29 20:38

    Check your build types of each project under project properties - I bet one or the other will be set to build against .NET XX - Client Profile.

    With inconsistent versions, specifically with one being Client Profile and the other not, then it works at design time but fails at compile time. A real gotcha.

    There is something funny going on in Visual Studio 2010 for me, which keeps setting projects seemingly randomly to Client Profile, sometimes when I create a project, and sometimes a few days later. Probably some keyboard shortcut I'm accidentally hitting...

提交回复
热议问题