Thursday, December 26, 2013

Visual Studio Tips #2 NuGet ( Auto update package and missing package)

In previous post Update Package Manager we tried to explain how to update the NuGet Package Manager.

These days we add many packages directly from NuGet in our application. Although all of these are not used and sometime we manage this situation and keep the used reference assemblies in different folder. Now instead of refer it from default package folder we add the reference from that assemblies folder.

It makes easy to manage the used assemblies for the project. But it cause the problem while we do integrate the code in our repository and forgot to add the assembly in referenced folder. Once the another team member took the update .. oops... it doesn't work and we need to check and manage assembly by our own.

But now integrated mode of IDE makes it more easy. You can enable or disable the facility to validate download and add the missing assemblies automatically at the time of compiling every time.

You can enable IDE to add the missing package automatically with the following setting steps:

    1. Right click on the Project in Solution Explorer > Select the Manage NuGet Packages as highlighted in screenshot below.

2. Select the Setting option

3. Go to the General Option of Package Manager option and Enable/Disable the option to download missing packages.

If the option is enabled your Visual Studio will check the missing packages and download it automatically to make your project work without worry of package assemblies in the project.

But if the referenced packages and assemblies are not in targeted default folder and you are following your own structure to keep the references then its better to disable and add the package manually to keep the assemblies at desire location.

No comments: