Use the open-source tool Nupack in ASP. net mvc 2

Source: Internet
Author: User

Nupack is a packaged. NET tool set developed by the Nupack team to enable developers to easily integrate third-party tools into your project.

Package Management is not a new concept. It has been used in Unixm, Ruby, and so on.

Introduction to Nupack previous blog http://weblogs.asp.net/scottgu/archive/2010/10/06/announcing-nupack-asp-net-mvc-3-beta-and-webmatrix-beta-2.aspx at ScottGu

However, it is a little difficult for developers who are not good at English. I will go from installation to usage here, with a detailed introduction.

I like the Extension Manager Tool of VS2010. You can directly use it to install NuPack. Of course, we mean you are using Asp.net MVC 2, if Asp.net MVC3 Preview is installed, you do not need to install Nupack again. It is automatically installed.

If it is Asp.net mvc2, don't worry. You can install it through the Extension manager Tool.

Open EMTs, select Online Gallery, and search for Nupack in the search box in the upper right corner ,:

Because I have installed it here, you can click download to download it and install it. Restart vs2010.

Next I will explain how to use Nupack. Create an Asp.net MVC 2 project first:

1. How to open the Package Manager Console?

PMC is not displayed in VS by default. You need to select it from View> Other windows> Package Manager Console and it will be displayed below.

2. How to Use the NuPack command

The first command is List-Package: Enter List-Package in the Package Manager Console, and you will see all the current third-party tools in NuPack, such:

If you need to Add a third-party tool to your project, you only need to enter Add-Package XXX. For example, we need to Add 'elmah 'to the project, enter the following in PMC:

If you do not know what elach is doing, go to google code to see the introduction of this open source project. It is mainly used to record the error information of your website. You can send the error information to you via email or twitter, or save it in the database. The above operation has added this third-party tool to your project. The web. config file has also been modified, that is, the configuration has been changed automatically. Very good.

Now try whether elmah can be used normally. Let's enter a url at will to let the system report an error. I will enter a shit/shit.

Then visit elmah. axd to see if the error log has been recorded.

Yes, it's recorded .....

Next, we will try to add nhib.pdf. linq to see what other amazing functions are available.

Wow, it will download the required tools by itself.

To remove nhib.pdf. linq, you just need to enter the following command in the console:

 
 
  1. PM> Remove-Package NHibernate.Linq –RemoveDependencies 

If you do not want to use the doscommand, you can add a Package.

There are many other functions. I hope you can take some time to introduce them later. If you are interested in this, you can also study it on your own. Today. Haha.

Cheers

Nick

If someone needs code for this project, leave a message. Enter the email below... In fact, the code is nothing.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.