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

推荐订阅源

MyScale Blog
MyScale Blog
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
N
Netflix TechBlog - Medium
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Vercel News
Vercel News
P
Palo Alto Networks Blog
C
CERT Recently Published Vulnerability Notes
Simon Willison's Weblog
Simon Willison's Weblog
I
Intezer
L
Lohrmann on Cybersecurity
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
The Register - Security
The Register - Security
T
Threat Research - Cisco Blogs
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
F
Fortinet All Blogs
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
V
Visual Studio Blog
Know Your Adversary
Know Your Adversary
博客园 - Franky
C
Check Point Blog
P
Privacy International News Feed
NISL@THU
NISL@THU
T
Tenable Blog
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog RSS Feed
A
About on SuperTechFans
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
G
Google Developers Blog
WordPress大学
WordPress大学
T
Threatpost
Y
Y Combinator Blog
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
T
Tor Project blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Spread Privacy
Spread Privacy

博客园 - 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。