Web应用程序项目V.S.网站项目 [英] web application projects v.s. web site projects
问题描述
我从以下链接阅读,
HTTP: //reddnet.net/$c$c/asp-net-web-site-vs-web-application-project-part-2/
我的两个混淆,
-
什么是所谓的问题,在你的命名空间无控制的从网站项目利弊?谁能告诉我一个样本来说明这个问题吗?
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 +净3.5 + C#。
I am using VSTS 2008 + .Net 3.5 + C#.
在此先感谢,
乔治
thanks in advance, George
推荐答案
假设一个网站...
这是一个简单的Web应用程序,所有孑然一身......记住,你不能添加任何东西了吧,对...?
that is a simple web app, all alone in the world... remember, you can't add anything else to it, right...?
现在,怎么样的 Web项目?这是一个解决方案的一部分,而解决方案可以有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:
在只有一个解决办法,我已经不是网站更多的项目,即使它们是在不同的目录我在网站上引用的那些项目,当我需要增加更多的可以很容易地编辑,例如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应用程序项目就像任何其他项目,将包括在像凸出扩展文件的项目中的所有文件,并且它当作一个项目,例如,您可以排除被编译的文件(你不能在一个网站),更容易,因为所谓的漂亮的插件<一的部署href=\"http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx\"相对=nofollow> 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...
你可以只部署该项目(将其添加到您的Web安装,以创建MSI文件),您将部署一个编译网站(无源$ C $ c为显示所有code编译成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应用程序项目V.S.网站项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!