Whats diference?

P

Paulo

Hi, what is diference between:

File -> New Web Site
and
File -> New Project -> VB/C# -> Web Application

??????

VS 2005

Thanks!
 
M

Mark Fitzpatrick

Two completely different types of project. The first creates a Web Site
Project. The second created a Web Application Project.

The main difference is the web site project does not compile into a single
dll, it creates many dlls, one for each page or directory.

The Web Application Project compiles all the code in the project into a
single dlls. The Web Application Project behaves more like the one that
shipped with VS 2003 and 2002. It was introduced for VS 2005 after launch
and later integrated into SP1 because a large number of developers didn't
like the new Web Site Project.
 
B

bruce barker

web application projects still create one dll per page. the difference
is that visual studio compiles the codebehind files into one dll, then
call the asp_compiler to build a dll per page, referencing the dll. so
web application actually end up with one more dll than web sites.

the practical difference is for web applications a project file is
maintained by visual studio (to compile the codebehind files) and
because the codebehinds are in one dll, they implicitly have a reference
to each other.

in a web site the pages are independent and if a page references another
page the proper way (as good coding would require anyway) is to
implement an interface in the app_code dir, then have the page implement
the interface. to call methods on another page, you cast it the known
interface. this turned out to be too complicated for causal coders, so
web application projects were added to asp.net 2.0.

i'd recommend you use web sites instead of web applications, as its a
cleaner approach.


-- bruce (sqlwork.com)
 
M

Mark Fitzpatrick

Bruce,
Where does the web application create additional dlls? This was the whole
point of the web application project and is one of the major features that
Scott Guthrie mentions in his announcement about their release? I've been
using it since the beta version of it and I only have the one dll for the
application, not one per page. Are you talking about the .compiled files
that are within the ASP.Net tempory cache? The only .compiled files I have
are for the ascx user controls in my app, not for all the pages.
 
I

Ian Semmel

Actually it seems a little more complicated than that.

As well as those two methods, you can also create a website in IIS and
Microsoft Expression.

All the methods seem slightly incompatible. Depending on how you created
it, you get different errors sometmes running them. VS uses its own web
server I think.

Anyway, as you asked, what's the best way ?
 
G

Guest

WAP project creates a temporary assembly for each ASPX "Page" in addition to
the single assembly for the "Site" in the /bin folder, same as VS 2003 always
did.
However Bruce asserts that Web Site projects are preferable, an idea with
which I totally disagree. It is Web Application Projects that are cleaner,
more manageable, and less prone to errors.
--Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
 
M

Mark Rae [MVP]

However Bruce asserts that Web Site projects are preferable, an idea with
which I totally disagree.

Me too, FWIW...
It is Web Application Projects that are cleaner, more manageable, and less
prone to errors.

Absolutely! I never, ever create a web site project in ASP.NET...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top