About Links Archives Search Feed Albums of Note

ASP.NET 4.0, Part 2: New VS Project Templates

Welcome to Day 2 of my tour through ASP.NET 4.0 [http://blog.hmobius.com/post/2010/02/09/ASPNET-40-Cometh.aspx]. In this article, we’ll be looking at the changes to the new web-related project templates available in VS2010 and see how most of them have been folded into the core VS product from various out of band projects released in the last five years.

Unless you’re the kind of person that likes cranking out literally every line of code in your app, you’ll be very comfortable using Visual Studio’s item and project templates. Want to start writing a new web service? Start a project with a WCF application project template as your guide. Want to write a Windows Forms application? Use the WinForms template. And so on. Until recently, web developers have had two choices - a web site or a web application project. We’ll not cover the difference between the two templates here - read here [http://blogs.msdn.com/aspnetue/archive/2009/12/14/asp-net-web-application-projects-vs-web-site-projects-in-visual-studio.aspx] or here [http://maordavid.blogspot.com/2007/06/aspnet-20-web-site-vs-web-application.html] for more info - but safe to say that while both are still with us in VS2010, they are back in altered forms.

(A quick note here to say that the new VS2010 New XYZ dialogs are much nicer than their counterparts from VS2008. It’s much easier to locate the items you want and you can even sort the templates as well (joy!). However I’ve necessarily cut and pasted sections from both VS2008 (left) and VS2010 (right) dialogs for ease of comparison. If it looks scruffy, it’s my fault, not theirs.)

The New Project Dialog Lots of changes here.

The New Website Dialog

The changes in the New Website dialog (VS2008 on the left, VS2010 on the right) are much the same as the new project dialog above albeit with the apparent non-sequitur that the WCF Service template is still available here. However, as the new dialog doesn’t offer any subcategories beyond Visual C# and Visual Basic, there’s no place else it can go. Besides that, the changes are as mentioned earlier. The Empty Web Site template includes a web.config file which it didn’t previously and the (non Empty) Web Site template generates the site structure noted earlier rather than the web.config and a blank ASPX page.

In this post we’ve looked at the changes in the website and web application project types from VS2008 to VS2010 and in particular at the new Empty and not empty Web Application projects. Next time, we’ll have a look at the new look web.config. Happy coding!

Posted on February 15, 2010   #Geek Stuff     #ASP.NET  

← Next post    ·    Previous post →