ProfileCommon() not found ...

Last post 05-13-2008 3:57 AM by Joeri Pansaerts. 7 replies.

Sort Posts:

  • ProfileCommon() not found ...

    05-10-2008, 3:01 AM

    I've maded in my Web.config a couple of properties, and now I would set these properties in my application.

        ProfileCommon pc = new ProfileCommon();
        pc.Initialize(txtNaam.Text, true);

        pc.Name = txtNaam.Text;
        pc.Email = txtMail.Text;
        pc.website = txtWebsite.Text;

        pc.Save();

    But here I get these error : Error 14 The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)  

    Kind Regards,

    Joeri Pansaerts.

    From Bruges, Belgium :)
  • Re: ProfileCommon() not found ...

    05-10-2008, 6:04 AM
    • Loading...
    • anas
    • Joined on 09-21-2006, 4:31 AM
    • Posts 3,680

    What  is the Project Type ? if its Web application Project "WAP",

    the Visual studio will not generate the profile Common Class , and you need to access the properties through GetPropertyValue ...

    I talked about this in my Blog: The Differences in Profile between Web Application Projects (WAP) and website

     
    However, if the project type is website , then i i guess you are writing that code in a separate class file or something, if thats the case

    read this thread : http://forums.asp.net/p/1212629/2145968.aspx
     

    Best Regards,

    Anas Ghanem| LogFile
  • Re: ProfileCommon() not found ...

    05-10-2008, 6:11 AM

    I don't think it's a WAP project (never heard before). Is that an addon or something like that ?

    Where can I find what kind of type my project is ? (I'm working with VS2008)

     

    EDIT : Ok, found :) . In VS2008 I don't have the choice for a website, so yes it's an application

    Kind Regards,

    Joeri Pansaerts.

    From Bruges, Belgium :)
  • Re: ProfileCommon() not found ...

    05-10-2008, 1:40 PM
    • Loading...
    • anas
    • Joined on 09-21-2006, 4:31 AM
    • Posts 3,680

    joeri pansaerts:
    Ok, found :) . In VS2008 I don't have the choice for a website, so yes it's an application
     

    Actually , the choice must be exists for the 2 options, 

    Now , if you used "File-> New Project" , it will be WAP .

    but If you used "File->New website" it will be website ...

     

    Jon Galloway provided a nice way to write a profile wrapper class when working with Profile In web application project(WAP),

    read it here


     

    Hope It Helps 

    Best Regards,

    Anas Ghanem| LogFile
  • Re: ProfileCommon() not found ...

    05-11-2008, 12:56 AM

    Yes I already followed all these tutorials of Jon Galloway, and when I'm making the Create() method in my UserProfile Class for an anonymous profile, the result will be null ... . So the problem is the same, I think there is a reason why I don't have the ProfileCommon() Class ...

     

    Maybe there is something wrong here :

       <membership defaultProvider="AspNetSqlMembershipProvider">
         <providers>
       <remove name="AspNetSqlMembershipProvider"/>
       <add connectionStringName="SqlProviderConnection" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
         </providers>
       </membership>

       <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
         <providers>
       <remove name="AspNetSqlRoleProvider"/>
       <add connectionStringName="SqlProviderConnection" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
         </providers>
       </roleManager>

       <profile enabled="true" automaticSaveEnabled="false" defaultProvider="AspNetSqlProfileProvider" inherits="UserProfile">
         <providers>
       <remove name="AspNetSqlProfileProvider"/>
       <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="SqlProviderConnection"/>
         </providers>
       </profile>


      
       <anonymousIdentification enabled="true" cookieName=".ASPANON" cookieTimeout="43200" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" cookieless="UseCookies" />

     

    Did I forgot something ?

    Thanks in advance Big Smile

    Kind Regards,

    Joeri Pansaerts.

    From Bruges, Belgium :)
  • Re: ProfileCommon() not found ...

    05-13-2008, 3:03 AM

    Ok I remaded my site in a Website, and now everything works fine

    But I don't understand what's the different between a WAP and a website ? Why they maded 2 different things ? Could somebody explain that ?

    I also see if you use a website, you don't have intellisense support when you use a UserControl dynamicly in your script with FindControl() ... that's not fine ! Why is that ? Or is that a bug ? Because my site works fine and the compiler finds my UserControl ... so I don't understand why there is no intellisense ?

     strange things Big SmileBig Smile

    Kind Regards,

    Joeri Pansaerts.

    From Bruges, Belgium :)
  • Re: ProfileCommon() not found ...

    05-13-2008, 3:31 AM
    Answer
    • Loading...
    • anas
    • Joined on 09-21-2006, 4:31 AM
    • Posts 3,680

    joeri pansaerts:
    But I don't understand what's the different between a WAP and a website ?

    The WAP added to visual studio 2005 in SP1 to make it easy to migrate the visual studio 2003 projects to 2005 projects,

    basicly WAP use the same build process as Visual studio 2003, it builds your web application into one assembly, where website didn't ..

    Refer to this link for more inforamtion and differences between them,

    joeri pansaerts:
    I also see if you use a website, you don't have intellisense support when you use a UserControl dynamicly in your script with FindControl() ... that's not fine ! Why is that ? Or is that a bug ?

    Actually , I'm not sure about this , but I don't think its a bug , again using WAP will make your visual studio behave like 2003 - but without the Bugs :)

     Like i mnetioned before, there is many differences between them , InProfile, In Resources(In WAP , there is no strong typed resources..)

    if you have more questions about the WAP and Visual studio, try to search VS 2005 Web Application Projects and Visual Studio 2005  Forums,

    if you didn't find what you want , ask your questions there ... because you will get a better help ....

     

    Best Regards,

    Anas Ghanem| LogFile
  • Re: ProfileCommon() not found ...

    05-13-2008, 3:57 AM

    Thank you very much for your help. I will ask it there, because there goes something wrong with my intellesense in the website projects with VS 2008 especially if i'm working with UserControls

    Kind Regards,

    Joeri Pansaerts.

    From Bruges, Belgium :)
Page 1 of 1 (8 items)