Asp.Net 2.0 Profile in Web Application Projects

· October 29, 2007

It has been a while since i coded web (not longing to much, i can say) and during this time a lot of development has happened of course. One of the great new features in ASP.NET 2.0 is the membership and profile handling which gives you easy access to store and get values that is has to do with the current user - a bit like settings in Windows programing.

A good introduction example can be found here.

However there is a problem in the different project models. When Visual Studio 2005 was released Microsoft did an attempt to solve the “i want to place my files for web projects wherever i want”-problem, and came up with the Web Site-project type. It sucks!

That project type doesn’t contain a project file and has a completely different compilation model, so it no good in most professional development projects. To do a build script for that kind of project is nigh on impossible…

So a new project type was released - Web Application Project. It is good! So good in fact that after Visual Studio SP1 - the web site project cannot be chosen and the Web Application project template is the only one left.

To bad that, in the progress, some features was removed - for example the automatically generation of a Profile-class to get easy access to the Profile-values in web.config.

Here is a add-in that gives you that feature back - ASP.NET WebProfile Generator. It will (they have promised) work in the next version of Visual Studio.

Twitter, Facebook