简体   繁体   English

VS2010参考在Windows应用程序中解析,但不在类库中解析

[英]VS2010 Reference Resolves in Windows Application but not in Class Library

I have a class library project that references another class library . 我有一个引用另一个类库的 类库项目。 The project fails to build and I get the error 'The type or namespace name 'ReportLibrary' does not exist in the namespace 'MSF' (are you missing an assembly reference?)' 该项目无法构建,我收到错误'名称空间名称'ReportLibrary'在名称空间'MSF'中不存在(您是否缺少程序集引用?)'

The weird part is that I have other projects referencing the same class library that build fine. 奇怪的是,我有其他项目引用相同的类库,构建良好。 The only difference is that they are Windows Application projects. 唯一的区别是它们是Windows应用程序项目。 If I change the project type to a Windows Application and add a Program.cs with a [STAThread] and it builds. 如果我将项目类型更改为Windows应用程序并添加带有[STAThread]的Program.cs并构建它。

So WTF ? 那么WTF Anybody know what I'm doing wrong? 谁知道我做错了什么?

Edit (More Details): All projects in the solution are set to the same Target Framework: .NET Framework 3.5 编辑(更多详细信息):解决方案中的所有项目都设置为相同的目标框架: .NET Framework 3.5

EDIT (Unobfuscated the error message per Hans) 编辑(未混淆每个Hans的错误消息)

Is the class library (with the error) targeting the Client Profile, and the applications (as well as the reference library) targeting the full framework? 类库(带有错误)是否以客户端配置文件为目标,而应用程序(以及参考库)是否以整个框架为目标? If so, this could cause the reference to be invalid, and cause that message. 如果是这样,这可能导致引用无效,并导致该消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM