Friday, August 1, 2008

type or namespace name 'ProfileCommon' could not be found

I recently hit this compile error while converting a Visual Studio web site project to a VS2008 Web App project: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)

Turns out that Web Applications don't support the auto generation of the ProfileCommon object like web site projects do. To get this to work install this VS addin and then add it to the build process as described here.


  1. Thanks so much Ellis Rocks, U ROCK!

  2. Isn't it possible to simply use:
    ProfileBase userProfile = ProfileBase.Create(userName, false);
    instead of :
    ProfileCommon userProfile = (ProfileCommon)ProfileCommon.Create(ouserName, false);
    Seems to work for me without the tools above.

  3. >Richard
    the reason why you would want to Generate the ProfileCommon class is that you can then get the strongly typed properties. With the profile base you are forced to write

  4. ProfileBase userProfile = ProfileBase.Create(userName, false);

  5. i have the same problem where i use like this

    ProfileCommon anonymousProfile = Profile.GetProfile(e.AnonymousID);

    and getting the same error. how can i make this work ?