views:

1885

answers:

8

When creating a new ASP.NET project in Visual Studio should I chose create: website or project?

I understand that web application project was the way to do it back in the day with VS 2003 but is it still applicable today? What are some of the caveats using one over the other?

A: 

The website mode was added for confused Interdev users ;-)

There is a certain ease of maintenance having the location and the project be the same thing, but for things like external assembly referencing it makes things more complicated.

It's no longer the default - MS seem to have gone back to projects. Personally I prefer the project mode.

Keith
+24  A: 

There's a pretty good comparison chart on MSDN.

Website projects are simple, in that all files added to the project folders are automatically compiled and included, which was supposedly added to make it more palatable to classic ASP and PHP developers. Once benefit is that it includes build providers, which allow for certain actions to be associated with a filetype - that's how the first release of SubSonic would rebuild the data access layer when you added a .abp file to the site.

Web Application Projects are a lot more flexible, though. For instance, all class libraries in a Website Project need to be in the App_Code folder, which is frustrating in a complex application. There are a lot of scenarios which just don't work for a Website Project.

You can convert from one to another, although if you're unsure I'd recommend just starting with a Web Application.

Jon Galloway
A: 

Keep in mind one of the most compelling features of Web Projects: SVN Integration, which is simply not properly possible with Web Sites.

Michael Stum
A: 

I prefer web applications for two reason:

  1. SVN or VSS integration
  2. XML based developer help generating
Biri
+1  A: 

People have already covered all the major angles here.. I find Web Apps to be useful for those "quick and dirty" apps.. Proof-of-concept code etc..

I tend to almost do "Web Project" on autopilot now :)

Rob Cooper
A: 

can someone edit this post to tag it so its actually searchable?

Adam
A: 

Some details from Apress – Pro ASP.NET 3.5 in C# 2008 Second Edition

Websites and Web Projects

Amr ElGarhy
+2  A: 

I strongly disagree with some of what the Websites and Web Projects article says.

First, it wasn't any "small" group of developers who rebelled - I'd suggest it was most of us, who had not been asked if we wanted to totally change the way we developed. They certainly didn't ask me if I wanted to lose six weeks of development time figuring out what they did to break a perfectly good web service.

It wasn't some "download" MS released - it was VS2005 SP1, and they released it pretty damned fast.

In their plusses for projectless development, the "Copy Project" command works very well, and we don't have to avoid debug or project files; you can move pages around - if you don't use source control; where do they get that you have to lock the project files in order to collaborate? What are they using for source control?

I'd also add one question to the debate: what's so special about web sites that they should be the only "project" type (as far as I know) that doesn't use a "project" file? I can't think of anything, unless it's that Microsoft thought that web developers were too simpleminded to understand projects.

Of course, if anyone knows of any other Visual Studio "project" type that does not use a project file, I'd be grateful to be informed of it.

John Saunders