2013年5月23日 星期四

Install self-created NuGet package with dependency

In the previous blog, Create a new NuGet package, we successfully create a NuGetExample.1.0.0.nupkg

image

Now, let’s using it in our Visual Studio project.

Create an empty MVC4 project, so far there is no Scripts folder

image

We can install jQuery but version 1.7 first into our project by execute command in Package Manager Console

Install-Package jQuery –Version 1.7

Now, Scripts folder and 3 jQuery .js files are added

image

Click to open Package Manager Settings

image

Add a new local source which we created in previous blog

image

Open Manager NuGet Packages window, switch to “Local 2” source, we are now able to install our own package, NuGetExample with jQuery 2.0 dependency

image

Installing…in progress

image

After that, we can see both our script file, MyNuGetScript.js and jQuery 2.0 are added in our project

image

*********************************************************************************************************

By the way, if we are trying to Uninstall-Package jQuery, we will encounter an error saying that due to NuGetExample has dependency with jQuery

image

沒有留言:

張貼留言