visual-studio Visual Studio 中网站和 Web 应用程序的区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3698362/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:27:02  来源:igfitidea点击:

Difference between website and web application in Visual Studio?

visual-studio

提问by andrew Sullivan

What is the difference between a web site and a web application?

网站和网络应用程序有什么区别?

回答by Ashwin Singh

FROM MCTS SELF-PACED TRAINING KIT

来自 MCTS 自定进度训练套件

Web applications and websites function and perform similarly, but web applications differ from websites in several important ways. For example, with a web application:

Web 应用程序和网站的功能和性能相似,但 Web 应用程序在几个重要方面与网站不同。例如,使用Web 应用程序

■ You can create an MVC application.

■ 您可以创建一个MVC 应用程序。

■ Visual Studio stores the list of files in a project file (.csproj or .vbproj), rather than relying on the folder structure.

■ Visual Studio 将文件列表存储在项目文件(.csproj 或 .vbproj)中,而不是依赖于文件夹结构。

■ You cannot mix Visual Basic and C#.

■ 不能混合使用 Visual Basic 和 C#。

■ You cannot edit code without stopping a debugging session.

■ 您不能在不停止调试会话的情况下编辑代码。

■ You can establish dependencies between multiple web projects.

■ 您可以在多个Web 项目之间建立依赖关系。

■ You must compile the application before deployment, which prevents you from testing a page if another page will not compile.

■ 您必须在部署之前编译应用程序,这会阻止您在另一个页面无法编译时测试页面。

■ You do not have to store the source code on the server.

■ 您不必将源代码存储在服务器上。

■ You can control the assembly name and version.

■ 您可以控制程序集名称和版本。

■ You cannot edit individual files after deployment without recompiling.

■ 如果不重新编译,您将无法在部署后编辑单个文件。

回答by Hiren Sakhiya

WEB APPLICATION

WEB应用程序

  • You explicitly compile the source code on the computer that is used for development or source control.
  • By default, compilation of code files (excluding .aspx and .ascx files) produces a single assembly.
  • Explicit namespaces are added to pages, controls, and classes by default.
  • 您在用于开发或源代码控制的计算机上显式编译源代码。
  • 默认情况下,代码文件(不包括 .aspx 和 .ascx 文件)的编译生成单个程序集。
  • 默认情况下,显式命名空间被添加到页面、控件和类中。

WEB SITE PROJECT

网站项目

  • The source code is typically compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated.

  • You can precompile the site (compile in advance on a development computer or on the server). By default, compilation produces multiple assemblies.

  • Explicit namespaces are not added to pages, controls, and classes by default, but you can add them manually.
  • 在站点安装或更新后第一次收到请求时,源代码通常由服务器上的 ASP.NET 动态(自动)编译。

  • 您可以预编译站点(在开发计算机或服务器上预先编译)。默认情况下,编译会生成多个程序集。

  • 默认情况下,显式命名空间不会添加到页面、控件和类中,但您可以手动添加它们。