DAL 层引用 System.Net.Http ,引发的一阵心慌

快下班的时候 代码data 数据层编译失败,引起整个解决方案全部失败;
其他同事虽然vs 版本不同,但是都能编译通过;考虑到今天更改过vs 的设置,把今天更改的设置全部都恢复,结果还是不行。最后直接恢复了原始设置;编译还是失败;
这时候才想起来看看编译日志具体的错误,编译日志:

MSB3268: The primary reference "data, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"
could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0".
To resolve this problem, either remove the reference "data, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"
or retarget your application to a framework version which contains "System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

到NETFramework v4.0 下找System.Net.Http 果然没有,从其他地方copy 一个放入目录,还是不行;
顺着这条线索 接着查 发现这玩意竟然是asp.net mvc 里的; 下载安装asp.net mvc 4 后,重新编译项目 问题迎刃而解了。。。

原文地址:https://www.cnblogs.com/baoconghui/p/9015401.html