Showing posts with label NuGet. Show all posts
Showing posts with label NuGet. Show all posts
Saturday, October 8, 2011

NuGet with multiple projects part-2

Before some days I have posted one post about how we can add NuGet package other than start project. In this post I am going to explain another way of doing that.

Earlier we have use ‘Manage NuGet Package’. Today I am going to use Package Manager Console for that. So let’s take same example which we have used in the earlier post. I have a sample application which have three projects.

MyApplication- Nuget with multiple projects.

As you can see in above post there are three projects.
  1. MyApplication-Main Web application project
  2. MyApplication.Business- This project has business logic classes for application
  3. MyApplication.Data- This project has database access layer classes for application
Now I want to add Entity Framework MyApplication.Data Project. As we have to use Package Manager Console. We need to open package manager console you have click Tools->Library Package Manager –>Package Manager Console. Once you click that it will open a console in visual studio like following


Now as I have to type following command in NuGet Package Manager Console to install EntityFramework Package to MyApplication.Data project

Get-Project MyApplication.Data | Install-Package EntityFramework

Here in above command Get-Project will get the project where we have to install the project and Install-Package will install the required package. As you can see entityframework reference added in MyApplication.Data Project in below image.


That’s it. Hope you like it. Stay tuned for more.. Till then Happy programming

Saturday, September 24, 2011

NuGet package with multiple projects

Before some day one of my friend asked me to install NuGet in project another then startup project. At that time I don’t have any idea about it. So I did some R and D on web and found one easiest way to do it. So let’s first create a solution where we have more then one project in single solution. I have created a new solution and create three project in single solution as below.
  1. MyApplication- Main web application project.
  2. MyApplication.Business- This project contains all business logic classes of application
  3. MyApplication.Data- This project contains all data access layers classes of application
Its looks like following.

Nuget Package with multiple solutions and adding NuGet Package to more then one project

Now I want to add EFCodeFirst NuGet package to MyApplication.Data project as I want to use entity framework code first for database operations. To add new package with in the project. you can select project and then click ‘Manage NuGet Packages’ like following.

Manage Nuget Pakcage with multiple project

Once you click it will show a dialog for NuGet Packages  like following.


I have selected EFCodeFirst and Once I clicked ‘Install’ . It has added reference to MyApplication.Data Project like following.

Entity Framework Nuget Package with multiple solution

That’s it. It’s very easy. Hope you like it..Stay tuned for more.. Till then happy programming and Namaste!!!.

Shout it
kick it on
Tuesday, April 5, 2011

NuGet Version 1.2 released

Someday ago Phil Haack from Microsoft has released the newer version of Nuget. There will be new exe for the newer version of the NuGet. Those who does not know about NuGet please visit my earlier post about NuGet

Followings are some new features of NuGet 1.2.

  1. Framework profile support
  2. Automatically add binary redirects
  3. Specifying Framework Assembly References (GAC)
  4. Nuget.exe is now able to store API key credentials.
  5. Package Explorer
To know about all the features in details please visit following link.

You can update to this version via following command.

NuGet.exe u

Shout it
kick it on
Tuesday, January 25, 2011

Installing Nuget package with package manager console step by step overview.

I have already blogged about NuGet in earlier post about how to install NuGet packages to your project with wizard. NuGet Extension also provides an package manager console to add library to your projects. Let’s install a blogml package via package manager console. So if you still not installed NuGet exntension then please read my earlier post here that explains how to install the NuGet Extension.

Once you are done with installing NuGet Extension to go to package manager console. You have to click Tools->Library package manager –>Package Manager console like following.


Once you click that menu you will get package manager console like following. PackageManagerConsolewindow

One you load an command line is available to you just need to write command to find packages and then you need to write command to install packages. let’s first see how many packages are available with the NuGet Extension. So first you have to write ‘get-package –remote’ command in command line to see what packages are available as following.


So It will load all the packages available in NuGet Now let’s filter some package via command. Suppose I want to install BlogML library to my project then I have to type ‘get-package –remote filter blogml’ and it will load all the packages that will contain BlogML like following.


Now let’s install BlogML library to my project for that I have to type ‘install-package blogml’ and it will install the package like following.


That’s it you can see Now your package is installed on your project and you find it in reference of your project like following.


It will also create packages.config and you can see installed packages there like following.

<?xml version="1.0" encoding="utf-8"?>
<package id="blogml" version="2.1.0" />

So that’s it as you can see its very easy to install NuGet package and its very convenient to install packages with this. Hope this help you. Stay tuned for more… Happy Programming..

Technorati Tags: ,,
Shout it

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog


My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews