关于"The dependency was added by the project system and cannot be removed" Error
阅读一个简单地工程代码,其中一个工程BaseCode是 static lib,另一个工程RunBaseCode使用该lib,但在工程设置的“Linker\Input\AdditionalDependencies” 中并没有添加对该lib的引用,而在“Linker\Command Line”中却发现BaseCode.lib已经添加进来了,这是怎么回事呢?
首先怀疑是Solution中设置的 “Project Dependencies”编译依赖,隐含的添加了lib,因此想把RunBaseCode对BaseCode的依赖去掉试试看。取消依赖时,却发现取消不了,出现"The dependency was added by the project system and cannot be removed" 错误。那这个编译依赖是在哪里添加的呢?

原来是在“Project References”中设置的。
右键\Properties\Common Properties\Framework and References\Add New Reference。

设置Reference后,该工程就自动加上了“Project Dependencies”。
那默认添加对BaseCode.lib的引用,是否是由于设置了“Project Dependencies”呢?不是的,是由于上面所述的设置“Reference”导致的。验证的情况如下:
1. 点击“Remove Reference”去掉工程关联后,默认的“Project Dependencies”也取消掉了。这时,手动添加“Project Dependencies”,发现“Linker\Command Line”中没有自动添加BaseCode.lib。
2. 将上一步骤中的“Project Dependencies”去掉,然后“右键\Properties\Common Properties\Framework and References\Add New Reference”,这时“Linker\Command Line”中自动添加了BaseCode.lib。
References
【1】Error while removing project dependency in VS2010 (http://stackoverflow.com/questions/12818315/error-while-removing-project-dependency-in-vs2010)
关于"The dependency was added by the project system and cannot be removed" Error的更多相关文章
- Android Studio添加应用作为依赖时报错Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: 及其解决方案
Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is ...
- [转]A reference to a higher version or incompatible assembly cannot be added to the project
If you face this error message while adding a reference to your project in Visual Studio try the fol ...
- [转帖]SAP一句话入门:Project System
SAP一句话入门:Project System http://blog.vsharing.com/MilesForce/A621279.html 这是SAP ERP入门的最后一篇了. 我们这些死跑龙套 ...
- Fix: Compile project encounter undefined reference to“xxx”error
Need to add all the new cpp files to jni/Andriod.mk folder:
- How to: Modify a Project System So That Projects Load in Multiple Versions of Visual Studio
http://msdn.microsoft.com/en-us/library/hh266706(v=VS.110).aspx
- Adding a custom jar as a maven dependency
Using maven in a Java project is great. It manages builds (as customized as you may need), execution ...
- 软件工程 week 02
一.地址链接 1.作业地址:https://edu.cnblogs.com/campus/nenu/2016CS/homework/2110 2.git仓库地址:https://git.coding. ...
- [asp.net core]project.json(1)
摘要 前面介绍了使用vs2015新建asp.net core web的内容,这篇文章学习下project.json文件的内容. project.json 原文:https://docs.microso ...
- maven 三个基本插件 clean dependency compiler
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
随机推荐
- 安装完成Windows服务后自动打开
使用DOS进程开启服务 设置serviceProcessInstaller1控件的Account属性为“LocalSystem”设置serviceInstaller1控件的StartType属性为&q ...
- Hash与Map
Hash与Map 面试时经常被问到,什么是Hash?什么是Map? 答:hash采用hash表存储,map一般采用红黑树(RB Tree)实现.因此其memory数据结构是不一样的,而且他们的时间复杂 ...
- [JS4] 最简单JS框架
<html> <head> <title></title> <SCRIPT TYPE="text/JavaScript"> ...
- Authentication in .NET Web Api
在介绍WebApi这个小demo前,先来简单说一下OAuth这个东西. OAuth开放授权,用户可以对自己的资源进行第三方授权,那么第三方就可以不用你的账号密码就可以访问你授权的资源了.比如一些论坛直 ...
- Atitit. C# java 的api 目录封装结构映射总结
Atitit. C# java 的api 目录封装结构映射总结 C# java ref System.Reflection System.Type, java.lang.ref concurrent ...
- 解决 "Windows 无法启动Mongo DB服务 错误:1067 进程意外终止"
在启动MongoDB服务时,有时会报上图所示的错误,解决方案为: 1. MongoDB安装目录\data\将此文件夹下的mongod.lock删除 2. 查看官方文档或按照上一篇安装文章检查是否设置d ...
- Xcode7
Xcode 7有什么新的特性.Xcode中7包含你需要创建的iPhone,iPad,Mac和Apple关注惊人的应用程序的一切.Swift编程语言已更新,现在比以往任何时候都更快,具有强大的功能,使你 ...
- iOS数据持久化-OC
沙盒详解 1.IOS沙盒机制 IOS应用程序只能在为该改程序创建的文件系统中读取文件,不可以去其它地方访问,此区域被成为沙盒,所以所有的非代码文件都要保存在此,例如图像,图标,声音,映像,属性列表,文 ...
- javaweb回顾第七篇jsp
1:为什么会有JSP jsp全名(java server pages)中文叫做java服务器页面.在Servlet那一篇我们发现用Servlet可以生成动态页面,但是我们却在Servlet中却写了大量 ...
- java中static{}语句块详解
static{}(即static块),会在类被加载的时候执行且仅会被执行一次,一般用来初始化静态变量和调用静态方法,下面我们详细的讨论一下该语句块的特性及应用. 一.在程序的一次执行过程中,stati ...