2

I am reading from the following link,

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

My two confusions,

  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?

  2. 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?

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

thanks in advance, George

Jon Limjap
  • 94,284
  • 15
  • 101
  • 152
George2
  • 44,761
  • 110
  • 317
  • 455
  • 1
    Hi George, I see you've asked several very similar questions to this. I think you should clean up your use profile a bit. You've got 183 questions asked and you've only accepted answers for a handful of them. If you kept those other questions active by re-visiting them and posting your progress, you're likely to get a lot more help than starting new questions all the time. – womp Jun 29 '09 at 06:17
  • Thanks womp, I agree with you. But this question is more specific. Another issue is I found new question is more attrative than comment on old questions. :-) – George2 Jun 29 '09 at 06:19
  • @blowdart, I read through the link you referred and it is really nice. But I do not think the reference answers my two questions. any comments or ideas? – George2 Jun 29 '09 at 16:58

1 Answers1

3

imagine a WebSite...

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

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:

alt text http://www.balexandre.com/temp/2009-06-29_0816_so_question.png

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.

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

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...

alt text http://www.balexandre.com/temp/2009-06-29_0825_soanswer.png

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).

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

balexandre
  • 73,608
  • 45
  • 233
  • 342
  • 6
    A "web site" project can also be part of a larger solution with other projects (e.g. class library projects) and the web site can reference these other projects as well. This is not a unique feature of web applications. – M4N Jun 29 '09 at 06:49
  • @balexandre, I am interested in the reference issue you mentioned, as I mentioned a similar issue in my original post item 2. Why for web site project, "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? – George2 Jun 29 '09 at 16:49
  • @Martin, how do you understand the item 2 reference issue I mentioned (quoted) in my original post? Looks like you do not think it is a real issue? Any comments? – George2 Jun 29 '09 at 16:50
  • A good write up, but as Martin mentioned Web Site Project can be added to Solutions. Also Web Deployment Projects work with Web Site Projects as well. – dtc Oct 31 '09 at 01:18