惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Tenable Blog
F
Full Disclosure
TaoSecurity Blog
TaoSecurity Blog
I
InfoQ
AI
AI
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
Y
Y Combinator Blog
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy International News Feed
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
I
Intezer
L
Lohrmann on Cybersecurity
博客园_首页
量子位
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
Cisco Talos Blog
Cisco Talos Blog
博客园 - 叶小钗
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
W
WeLiveSecurity
N
News and Events Feed by Topic
S
Schneier on Security
T
Tor Project blog
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
T
Threat Research - Cisco Blogs
H
Help Net Security
V
V2EX
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
博客园 - Franky
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler

博客园 - vibration

ATL3.0组件注册bug的解决方法 OLE2T在VS2003中转换中文失败的问题及解决方法 标题栏按钮的WTL实现 AppBar的WTL实现 招聘C++和C#开发工程师 ATL组件中文路径注册问题(转载) 关于C++模板的连接问题 - vibration - 博客园 用窗口消息解决COM接口的多线程访问问题 用全局接口表实现COM接口在不同线程中的传递 MyMSN支持自定义内容了 自画菜单的WM_MEASUREITEM只会发送一次 悼念皮皮 上了点照片 一个测试记忆力的小游戏 老板该如何向核心员工许诺 ActiveScript SkinX界面换肤框架更新 反射获取定制Attribute Skin技术实现框架(完)
奇怪的引用错误及解决方法
vibration · 2005-11-16 · via 博客园 - vibration

碰到一个奇怪的问题。

症状
在一个.net workspace中包含多个project,其中两个project应用了同一个.net assamply。这两个project其中一个编译正常,另一个则报错:

error CS0246: The type or namespace name '***' could not be found (are you missing a using directive or an assembly reference?)
居然说我没有正确引用,可是检查项目设置都没有问题。关闭workspace在打开,好了。第二天再编译,又有问题,晕了

错误原因

google半天未果,自己研究。发现被引用的项目有一个Copy Local属性,默认为true,就是把应用的assamply拷贝到输出目录下。原来两个project都企图把同一个assamply拷贝过来,而拷贝成功后还锁定了这个文件。这样第一个项目操作成功并锁定文件后,第二个项目拷贝就失败了,因为无法覆盖被锁定的文件。

解决方法

原因找到了,解决就不难了,把其中一个项目中的引用assambly的Copy Local属性改成false,再编译,就一切OK了 同理,如果有多个project引用同一assamply,除了其中一个的Copy Local属性为true,其他改成false就行了。GAC中的assambly不存在此问题,因为默认Copy Local属性为false。