1

I want to make my .net 4 project load the .net 3.5 version of a nuget package so that other .net 3.5 references don't get the nuget dll overwritten in the output directory.

1 Answer 1

3

Yikes! If the package has a .NET 3.5 and a .NET 4 version of the DLL, there's no real way to do that other than changing your project to target 3.5 itself.

I can think of a couple of workarounds though. They're not ideal, but they'd probably work.

  1. After you install the nuget package, go into the "packages" directory (it'll be next to your solution (.sln) file. Find the package. Delete the "\lib\net40" folder. This way, NuGet will reference the next version down. You'll have to manually change the assembly reference. Note if you even upgrade this package, you'll have to do this again.

  2. You could create a custom version of this package that only contains your 3.5 version of the DLL. Perhaps put this up in a custom feed at http://myget.org/ and install it from there.

One of those ought to work.

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome thanks, basically its not really supported? I know its kinda a wierd case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.