C# ASP.NET SQL SERVER

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.

» Similar Posts

  1. Order of Usings in C#
  2. Deployed ASP.NET MVC app gives 404 on About Page
  3. Create a chart using .NET 4 and ASP.NET MVC

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://guyellisrocks.com/trackback.ashx?id=60

» Comments

  1. SAM AMEGAVI avatar

    Thanks so much Ellis Rocks, U ROCK!

    SAM AMEGAVI — June 15, 2009 7:58 AM
  2. Ahmed Assem avatar

    Thanks a lot

    Ahmed Assem — July 29, 2009 7:08 AM
  3. Richard avatar

    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.

    R

    Richard — January 8, 2010 11:51 AM
  4. Tahir avatar

    >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

    userProfile["MyProperty"]

    Tahir — February 25, 2010 4:53 PM
  5. tet avatar

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

    tet — April 30, 2011 6:34 AM

» Leave a Comment