简体   繁体   English

什么是Microsoft ASP.NET网页2数据Nuget包?

[英]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: 我知道ASP.NET MVC 4项目所需的最小Nuget包是:

  • Microsoft ASP.NET MVC 4 Microsoft ASP.NET MVC 4
  • Microsoft ASP.NET Razor 2 Microsoft ASP.NET Razor 2
  • Microsoft ASP.NET Web Pages 2 Microsoft ASP.NET网页2
  • Microsoft.Web.Infrastructure 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网页2数据
  • Microsoft ASP.NET Web Pages 2 Web Data Microsoft ASP.NET网页2 Web数据

ie 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. 每个nuget项目的描述与Razor 2包的描述相同,这对它没有太大帮助。

After doing some experimenting with MVC 4 Projects with and without the following packages 在使用和不使用以下软件包进行MVC 4项目的一些实验之后

  • Microsoft ASP.NET Web Pages 2 Data Microsoft ASP.NET网页2数据
  • Microsoft ASP.NET Web Pages 2 Web Data Microsoft ASP.NET网页2 Web数据

I have come to the conclusion that the Nuget Package description of 我得出的结论是Nuget Package的描述

This package contains the runtime assemblies for ASP.NET Web Pages. 此包包含ASP.NET网页的运行时程序集。 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. ASP.NET Web Pages和新的Razor语法提供了一种快速,简洁,干净且轻量级的方法,可将服务器代码与HTML相结合,从而创建动态Web内容。

is very misleading. 是非常误导。

The Microsoft ASP.NET Web Pages 2 Data actually just contains the WebMatrix.Data.dll. Microsoft ASP.NET Web Pages 2数据实际上只包含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 查看此程序集MSDN参考

The WebMatrix.Data namespace contains classes that simplify database interaction in ASP.NET Web Pages. WebMatrix.Data命名空间包含简化ASP.NET网页中数据库交互的类。 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. 此命名空间包括可帮助您打开,查询和向数据库发送命令以及使用SQL查询返回的数据库行的类。

And for the Microsoft ASP.NET Web Pages 2 Web Data, this package only adds the WebMatrix.DataWeb.dll (dependent on WebMatrix.Data.dll). 对于Microsoft ASP.NET Web Pages 2 Web数据,此程序包仅添加WebMatrix.DataWeb.dll(依赖于WebMatrix.Data.dll)。 The MSDN reference for this assembly is 此程序集MSDN参考

The WebMatrix.WebData namespace contains classes that simplify membership and security in ASP.NET Web Pages. WebMatrix.WebData命名空间包含可简化ASP.NET网页中的成员资格和安全性的类。 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. 因此,如果不使用WebMatrix Data访问数据库而不使用简单的成员资格提供程序,则不需要这些软件包。

If you are using the Simple Membership provider, or extending the Extended Membership Provider, then these packages are necessary. 如果您使用简单成员资格提供程序或扩展扩展成员资格提供程序,则必须使用这些程序包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM