August 15, 2007
@ 12:25 AM

ASP.NET 2.0 introduced a new feature called Profiles where a web application can create users' profile - ASP.NET provides all of the plumbing work for you; all we have to do is define some settings in the web.config file and get/set properties on the Profile object in our code. Pretty simple.

I have been using the Profile feature for quite some time without any problems but yesterday I ran into a problem. No matter what I tried, I always got the Profile object null. After performing a little bit of research I came to know that the problem is with the Microsoft Office Sharepoint Server (MOSS) which is also installed on the development machine that I was working on!

Under the hood, ASP.NET Profile feature is implemented by a ProfileModule (an ASP.NET module) which gets run and initializes the Profile object during each request. When MOSS is installed on a machine, it clears some of the modules from the HTTP request processing pipeline and ProfileModule is one of those modules!

Hence adding the following line in my web application's config file did the trick for me.

<add name="Profile" type="System.Web.Profile.ProfileModule" />

Hope this tip would help others who might be facing the same problem.