【发布时间】:2015-02-20 06:04:31
【问题描述】:
这种情况与 nuget 的整个工作方式有点背道而驰,所以我可能要求的是 hack...
我的问题:
我需要在进入 SQL-CLR for Server 2008 的 .net 程序集中引用 Restsharp 和 Protobuf-net(因此最大 .net 3.5,框架 2.0)。
Restsharp 回到 3.5 成为受支持的最低 fwk 版本。
Protobuf-net 3.5 及更高版本有很多涉及 system.servicemodel(和 WCF)的垃圾,我不需要和使用这些垃圾,并且积极想要删除它们,因为它会导致在 SQL-CLR 上安装时出现问题。 Protobuf-net 2.0 没有这个:)
因此,我使用面向 .net 3.5 的程序集构建并测试了我的代码,并安装了 restsharp nuget - 它为我提供了正确的引用,我手动添加了对 protobuf-net 2.0 发行版的引用。
这是我想知道的地方 - 我可以(以任何方式)安装 protobuf-net nuget 包,但仍然让它在我的程序集中引用针对 3.5 的 .net20 DLL 吗?
静态引用并不是什么大问题,因为 protobuf-net 已经相当稳定了,但如果可能的话,我想通过 nuget 获得整个设置。
最后,这是一种解决方法: protobuf-net version without system.servicemodel dependency?
如果有更好的答案,我将非常感激:)
【问题讨论】:
标签: nuget protobuf-net