ASP.NET 2.0 Profile with Web Application Project Gotcha

by Peter Tyrrell Monday, January 08, 2007 12:20 PM

When using Web Application Project with Visual Studio 2005 instead of Website Project, the profile personalization feature new to ASP.NET 2.0 doesn't "just work" the way all the articles describing Membership and Profile say it does. The strongly-typed ProfileCommon class is not auto-generated and Intellisense tells you it has no idea what you're talking about when you attempt to access HttpContext.Profile from code.

ScottGu reveals (full article):

VS 2005 Web Application Projects don't automatically support generating a strongly-typed Profile class proxy. However, you can use this free download to automatically keep your own proxy class in sync with the profile configuration.

I got quite frustrated, enough to bang the desk, but fortunately not enough to emit a Primal Yodel. As usual, Super Ted came to the rescue and pointed me to the above download.

UPDATE June 25, 2007 - The gotdotnet site in the "free download" link above has shut its doors, possibly forever, so here is a copy of the Web Profile Generator for your downloading pleasure: Web Profile Generator download.

UPDATE II from Ted, July 4, 2007 - As of yesterday, the Web Profile Generator lives again on CodePlex:

blog comments powered by Disqus

Month List