引用的项目得到"失去"在编译时 [英] Referenced Project gets "lost" at Compile Time

查看:90
本文介绍了引用的项目得到"失去"在编译时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个项目,一个C#的解决方案:即服务(主体工程)和一个记录器。该服务使用类从记录器。我添加了一个引用到服务项目中的记录项目。在设计时,自动完成正常工作:记录器的类是可见的,我用适当有色引用

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 within the service project. At design time, autocomplete works fine: the logger's classes are visible, references that I use are colored appropriately.

我重新生成解决方案,并不如意的事情。引用不再承认:这个名字记录并不在当前情况下存在'和类自动完成不复存在拆卸和重新连接参考让我回到基态具有标识符可见的自动完成。

I Rebuild the solution, and things go wrong. The references are no longer recognized: "The name 'Logging' does not exist in the current context' and the classes no longer exist in autocomplete. Removing and re-attaching the reference gets me back to the base state of having the identifiers visible to autocomplete.

我已经重新启动,清除所有缓存,确信这是VS 2010的在我的机器上运行的唯一实例。

I've rebooted, cleared all caches, made sure this is the only instance of VS 2010 running on my machine.

有什么明显的(显然)我失踪?

Is there something obvious (obviously) that I'm missing?

推荐答案

检查您的构建类型的每个项目下的项目属性 - 我敢打赌,一方或另一方会被设置为建立对 .NET XX - 客户简介

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.

有在Visual Studio 2010中有趣的事情对我来说,东西保持设定的项目看似随机为客户端配置文件,有时当我创建一个项目,有时几个天后。可能是一些键盘快捷键,我不小心击中...

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...

这篇关于引用的项目得到"失去"在编译时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆