0

I am java programmer and recently I have to work on a .NET project. Actually, I want to use the same way as the MIGHTY Maven manages the dependencies in the project and I found there is a Nuget tool to do the same. But my problem is how to get the exact library version and its related dependencies according to what I have in .NET's project file. Somehow I found the Nuget can find the dependencies and add them as reference to the project. The problem is , in some cases, I want to add EnterproseLibrary version 5 including commons, logging, exception handling, data and unity. I got everything but it has error in some namespaces which should be added by Nuget like the following: Microsoft.Practices.EnterpriseLibrary.Logging.Database

I also notice if I want to get version 5 of enterpriselibrary I should use EntLibContrib instead of EnterpriseLibrary and it is totally confusing. And if I want to add Data namespace I should use version 6 of EnterpriseLibrary in Nuget. because in version 5 I just find: the following:

EntLibContrib.Data.MySql EntLibContrib.Data.OdpNet

I googled too much, especially official nuget documentation, and I am really getting tired of all .NET altogether. I need a good reference for Nuget or every other Repository, Package and build management in .Net.

Update:

For example I have the following reference in csproject file:

<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\BinaryReferences\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
</Reference>

I know the version of each library and I want to add them to package.config file as Nuget format to restore them. I want to use Nuget to build, package and deploy instead of the traditional way of building project in Visual Studio.

I java for example we can use mvnrepository to findout each version of library we want and use it in our pom.xml file. In .NET I don't know how to find the exact version of the library and address it in Nuget package.config/json file.

After two days reading its document I know enough about its features and powershell commands. I just want to know, is there any way to find the library version based on its namespace, like I do every day with maven repository. Or my expectation about Nuget is too much high.

Mehdi
  • 746
  • 1
  • 10
  • 25
  • Question already answered [here](http://stackoverflow.com/questions/5628689/download-old-version-of-package-with-nuget). – Genti Saliu Mar 19 '16 at 17:42

2 Answers2

0

Can you please clarify what exactly the problem is? You can reference a specific nuget package version in your project. The version that you will choose depends on what features you require, and what versions of the libraries inside the package you would like to get. You can install a specific version of NuGet package using Package Manager Console. The exact structure package actually differ, depending on what package source you used, however every package describes it's dependencies - read about nuspec, so you know exactly what you're getting. Once a package is added to a project, you will see a package.config where you actually specify package version and target framework

<package id="NSubstitute" version="1.9.2.0" targetFramework="net46" />

If you are uncertain which package version to choose, you can always check the contents and see which assemblies exactly are included, this should be described on nuget.org, but if you're using other source, you can always unzip the nupkg file, or use NuGetPackage Explorer

ironstone13
  • 3,325
  • 18
  • 24
0

To install nuget package for Enterprise data block version 5, you need to run the following command in nugey package manager console - (more details)

Install-Package EnterpriseLibrary.Data -Version 5.0.505

EntLibContrib is not Enterprise Library exactly, but it is an extension that is made on top of it. Please refer this for more details.

Yogi
  • 9,174
  • 2
  • 46
  • 61