nuget package manager does not offer older versions of package

Viewed 38

I inherited some old legacy code which I'm trying to build, but I'm missing some specific dlls. In particular, I need version 4.0.0.0 of System.ComponentModel.Composition, but the Nuget Package Manager options only go down to 4.5.0. Why is this, and how can I get the version I need?

Here is the line specified by the Web.config file I inherited.

<add assembly="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

enter image description here

__

Edit: I tried Jingmiao Xu-MSFT's solution but I'm getting an error saying I'm already referencing these packages. Then I noticed that I'd commented out these assembly lines in my Web.config, so where are these packages being referenced from?

enter image description here

1 Answers

According to your description, you can refer to the following steps to find the dlls you need:

  1. Right-click on the References under your project in Solution Explorer.
  2. Choose Assemblies and search System.ComponentModel.Composition, System.Net.Http.WebRequest enter image description here enter image description here
  3. Check them and add them to the project.
Related