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.
![Nuget Package with multiple solutions and adding NuGet Package to more then one project Nuget Package with multiple solutions and adding NuGet Package to more then one project](https://lh5.ggpht.com/-b8ac7EVNeYI/TnzYS8_5uWI/AAAAAAAAA6M/Dk-YZuTTFFg/ThreeSolutionForNuget_thumb%25255B1%25255D.png?imgmax=800)
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 Manage Nuget Pakcage with multiple project](https://lh6.ggpht.com/-6cmzWhlbcRw/TnzYculrfBI/AAAAAAAAA6U/ITiOPt7qwfc/ManageNuGetPakcage_thumb%25255B1%25255D.png?imgmax=800)
Once you click it will show a dialog for NuGet Packages like following.
![NuGetPacakge NuGetPacakge](https://lh6.ggpht.com/-QORZld_0ZYs/TnzYmp1v41I/AAAAAAAAA6c/dbgHgMjdLrg/NuGetPacakge_thumb%25255B1%25255D.png?imgmax=800)
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 Entity Framework Nuget Package with multiple solution](https://lh3.ggpht.com/-KVT4yNIbzo8/TnzY15APqlI/AAAAAAAAA6k/_f2HMNmrIh4/EntityFramework_thumb%25255B1%25255D.png?imgmax=800)
That’s it. It’s very easy. Hope you like it..Stay tuned for more.. Till then happy programming and Namaste!!!.
- MyApplication- Main web application project.
- MyApplication.Business- This project contains all business logic classes of application
- MyApplication.Data- This project contains all data access layers classes of application
![Nuget Package with multiple solutions and adding NuGet Package to more then one project Nuget Package with multiple solutions and adding NuGet Package to more then one project](https://lh5.ggpht.com/-b8ac7EVNeYI/TnzYS8_5uWI/AAAAAAAAA6M/Dk-YZuTTFFg/ThreeSolutionForNuget_thumb%25255B1%25255D.png?imgmax=800)
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 Manage Nuget Pakcage with multiple project](https://lh6.ggpht.com/-6cmzWhlbcRw/TnzYculrfBI/AAAAAAAAA6U/ITiOPt7qwfc/ManageNuGetPakcage_thumb%25255B1%25255D.png?imgmax=800)
Once you click it will show a dialog for NuGet Packages like following.
![NuGetPacakge NuGetPacakge](https://lh6.ggpht.com/-QORZld_0ZYs/TnzYmp1v41I/AAAAAAAAA6c/dbgHgMjdLrg/NuGetPacakge_thumb%25255B1%25255D.png?imgmax=800)
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 Entity Framework Nuget Package with multiple solution](https://lh3.ggpht.com/-KVT4yNIbzo8/TnzY15APqlI/AAAAAAAAA6k/_f2HMNmrIh4/EntityFramework_thumb%25255B1%25255D.png?imgmax=800)
That’s it. It’s very easy. Hope you like it..Stay tuned for more.. Till then happy programming and Namaste!!!.
0 comments:
Post a Comment
Your feedback is very important to me. Please provide your feedback via putting comments.