Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Microsoft ASP.NET Web Pages 2 Data Nuget Package for?

I understand that the minimum Nuget packages that I need for an ASP.NET MVC 4 Project are:

  • Microsoft ASP.NET MVC 4
  • Microsoft ASP.NET Razor 2
  • Microsoft ASP.NET Web Pages 2
  • Microsoft.Web.Infrastructure

However I am interested to know, what would the following packages add to the project?

  • Microsoft ASP.NET Web Pages 2 Data
  • Microsoft ASP.NET Web Pages 2 Web Data

i.e. What do these two packages do? The description for each of these nuget projects is the same description as Razor 2 package, which isn't too helpful.

like image 835
Sylvia Avatar asked May 16 '13 08:05

Sylvia


People also ask

What is NuGet package in asp net core?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.

What is NuGet in ASP NET MVC?

NET and Visual Studio. NuGet can be used to find and install packages, that is, software pieces and assemblies and things that you want to use in your project. NuGet is not a tool that is specific to ASP.NET MVC projects.


1 Answers

After doing some experimenting with MVC 4 Projects with and without the following packages

  • Microsoft ASP.NET Web Pages 2 Data
  • Microsoft ASP.NET Web Pages 2 Web Data

I have come to the conclusion that the Nuget Package description of

This package contains the runtime assemblies for ASP.NET Web Pages. ASP.NET Web Pages and the new Razor syntax provide a fast, terse, clean and lightweight way to combine server code with HTML to create dynamic web content.

is very misleading.

The Microsoft ASP.NET Web Pages 2 Data actually just contains the WebMatrix.Data.dll. This the only assembly that is added to your project when adding this package. Looking at the MSDN reference for this assembly

The WebMatrix.Data namespace contains classes that simplify database interaction in ASP.NET Web Pages. This namespace includes classes that help you to open, query, and send commands to a database, and to work with database rows that are returned by SQL queries.

And for the Microsoft ASP.NET Web Pages 2 Web Data, this package only adds the WebMatrix.DataWeb.dll (dependent on WebMatrix.Data.dll). The MSDN reference for this assembly is

The WebMatrix.WebData namespace contains classes that simplify membership and security in ASP.NET Web Pages. This namespace includes classes that help you create and delete user accounts, define roles, and manage account passwords.

So if not using WebMatrix Data to access databases and not using the simple membership provider, these packages are unnecessary.

If you are using the Simple Membership provider, or extending the Extended Membership Provider, then these packages are necessary.

like image 141
Sylvia Avatar answered Oct 22 '22 00:10

Sylvia