微软 web框架_Microsoft .NET Web编程:网站与Web应用程序

微软 web框架

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x

在.NET 2.0中,Microsoft引入了该网站。 这是在Visual Studio 2005中创建Web项目的默认方法。在Visual Studio 2008中,已将Web应用程序还原为Visual Studio / .NET 3.x中的默认Web项目。

The Web Site is a file/folder based Project structure.  It is designed such that pages are not compiled until they are requested ("on demand").  The advantages to the Web Site are:

该网站是基于文件/文件夹的项目结构。 它被设计为在请求页面之前(“按需”)不编译页面。 该网站的优点是:

      1) It is designed to accommodate non-.NET Applications

1)设计用于容纳非.NET应用程序

      2) Deployment is as simple as copying files to the target server

2)部署就像将文件复制到目标服务器一样简单

      3) Any portion of the Web Site can be updated without requiring recompilation of the entire Site.

3)网站的任何部分都可以更新,而无需重新编译整个网站。

The Web Application is a .dll-based Project structure.  ASP.NET pages and supporting files are compiled into assemblies that are then deployed to the target server.  Advantages of the Web Application are:

Web应用程序是基于.dll的项目结构。 ASP.NET页和支持文件被编译成程序集,然后将其部署到目标服务器。 Web应用程序的优点是:

      1) Precompiled files do not expose code to an attacker

1)预编译的文件不会向攻击者公开代码

      2) Precompiled files run faster because they are binary data (the Microsoft Intermediate Language, or MSIL) executed by the CLR (Common Language Runtime)

2)预编译的文件运行速度更快,因为它们是由CLR(公共语言运行时)执行的二进制数据(Microsoft中间语言或MSIL)

      3) References, assemblies, and other project dependencies are built in to the compiled site and automatically managed.  They do not need to be manually deployed and/or registered in the Global Assembly Cache:  deployment does this for you

3)引用,程序集和其他项目依赖项内置到已编译的站点中并自动进行管理。 它们不需要手动部署和/或在Global Assembly Cache中注册:部署可以为您完成此任务

If you are planning on using automated build and deployment, such as the Team Foundation Server Team Build engine, you will need to have your code in the form of a Web Application.  If you have a Web Site, it will not properly compile as a Web Application would.  However, all is not lost:  it is possible to work around the issue by adding a Web Deployment Project to your Solution and then:

如果您打算使用自动化构建和部署,例如Team Foundation Server Team Build引擎,则需要以Web应用程序的形式编写代码。 如果您有一个网站,它将无法像Web应用程序那样正确地进行编译。 但是,一切都不会丢失:可以通过在解决方案中添加Web部署项目来解决此问题,然后:

  a) configuring the Web Deployment Project to precompile your code; and

a)配置Web部署项目以预编译您的代码; 和

  b) configuring your Team Build definition to use the Web Deployment Project as its source for compilation.

b)配置团队构建定义以使用Web部署项目作为其编译源。

There is an excellent Microsoft webcast by Zain Naboulsi going into detail about the differences (and how to convert a Web Site to a Web Application) here:

Zain Naboulsi提供了出色的Microsoft网络广播,其中详细介绍了这些差异(以及如何将网站转换为Web应用程序):

https://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-US&EventID=1032380764&CountryCode=US https://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=zh-CN&EventID=1032380764&CountryCode=US

翻译自: https://www.experts-exchange.com/articles/4358/Microsoft-NET-Web-Programming-Web-Sites-versus-Web-Applications.html

微软 web框架

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值