Web 应用程序项目 vs.网站项目 [英] web application projects v.s. web site projects

查看:31
本文介绍了Web 应用程序项目 vs.网站项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读以下链接,

http://reddnet.net/code/asp-net-web-site-vs-web-application-project-part-2/

我的两个困惑,

  1. 网站项目中所谓的无法控制您的命名空间"的缺点是什么?谁能给我看一个样本来说明这个问题?

  1. What is the so-called issue "No control over your namespaces" cons from a web site project? Could anyone show me a sample to illustrate this issue please?

所谓的很难(阅读,几乎不可能)从 app_code 文件夹中的自定义类中引用页面、用户控件等."是什么问题?谁能给我看一个样本来说明这个问题?

What is the so-called issue "It is hard (read, nearly impossible) to reference pages, user controls, etc from custom classes in the app_code folder."? Could anyone show me a sample to illustrate this issue please?

我使用的是 VSTS 2008 + .Net 3.5 + C#.

I am using VSTS 2008 + .Net 3.5 + C#.

提前致谢,乔治

推荐答案

想象一个网站...

这是一个简单的网络应用程序,在世界上独一无二......记住,你不能向它添加任何其他东西,对吧......?

that is a simple web app, all alone in the world... remember, you can't add anything else to it, right...?

现在,网络项目怎么样?它是一个解决方案的一部分,一个解决方案可以有 n 个项目,以我目前的工作为例:

Now, how about a web project? that it's part of a Solution, and a Solution can have n projects, take my current work for example:

替代文字 http://www.balexandre.com/temp/2009-06-29_0816_so_question.png

在一个解决方案中,我有比网站更多的项目,即使它们在不同的目录中,我也引用了网站中的这些项目,并且很容易编辑,例如,当我需要添加更多项目时,ExtensionMethods 项目.

In just one solution, I have more projects than the website, and even if they are in different directories I referenced those projects in the website and it's easy to edit, for example, the ExtensionMethods project when I need to add more.

这是您无法在网站中控制的事情,只能在 Web 应用程序项目中进行控制.

This is something that you can't control in a WebSite, only in a Web Application Project.

Web 应用程序项目和其他任何项目一样,它包括项目中的所有文件,如 proj 扩展文件,并将其视为项目,例如,您可以排除要编译的文件(您不能在一个网站),它更容易部署,因为名为 Web 部署项目",只需右键单击您的网站项目并选择添加 Web 部署项目...

The Web Application Project is like any other project, it includes all files that are in Projects like the proj extension file, and it's treated like a project, for example, you can exclude files to be compiled (you can't in a Website), it is easier to deploy because of the nice plugin called Web Deployment Project", just right click in your WebSite project and choose Add Web Deployment Project...

替代文字 http://www.balexandre.com/temp/2009-06-29_0825_soanswer.png

并且您只能部署此项目(将其添加到您的 Web 安装程序中,以便创建 msi 文件)并且您将部署一个已编译的网站(不显示源代码,所有代码都编译为 dll,因此您可以隐藏来源).

And you can deploy only this project (add it to your Web Setup, in order to create the msi file) and you will deploy a compiled website (no source code is showed, all code is compiled into dll's so you can hide the source).

与简单的网站相比,使用 Web 应用程序项目有许多优点...

There are numerous advantages to use Web Application Project over a simple Website...

这篇关于Web 应用程序项目 vs.网站项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆