nuget - Reference specific framework version from installed package?

空扰寡人 提交于 2019-12-12 05:12:20

问题


This scenario goes a bit against the whole way nuget works so what i might be asking for is a hack...

My problem:

I need to have Restsharp and Protobuf-net referred to in a .net assembly that going into SQL-CLR for Server 2008 (so max .net 3.5, framework 2.0).

Restsharp goes back to 3.5 as the lowest supported fwk version.

Protobuf-net 3.5 onwards has a lot of gunk referring to system.servicemodel (and WCF) which i don't need and use and actively want to remove because it causes issues with installing on SQL-CLR. Protobuf-net 2.0 doesn't have this :)

So i've built and tested my code with an assembly targeting .net 3.5 and i installed the restsharp nuget - which gave me the correct reference and i manually added a reference to the protobuf-net 2.0 distro.

This is where i'd like to know - can i (in any way) install the protobuf-net nuget package but still have it reference the .net20 DLL in my assembly which targets 3.5?

The static reference is not a huge deal since protobuf-net has been pretty stable, but i'd like to get the whole setup via nuget if possible.

In the end, this is a workaround as solution to: protobuf-net version without system.servicemodel dependency?

If there's a better answer to that, i'd be very grateful :)


回答1:


As far as I know, that is not possible. You could of course create your own custom build and host it on a local nuget drop, or as your own nuget package on the public feed. AFAIK, there's no way to do what you want inside a new nuget folder in the existing package.



来源:https://stackoverflow.com/questions/28571852/protobuf-net-version-without-system-servicemodel-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!