Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6687267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:16:05+00:00 2026-05-26T05:16:05+00:00

I have a Web Application Project and implemented profile properties in the web.config. When

  • 0

I have a Web Application Project and implemented profile properties in the web.config. When I found that I couldn’t access the ProfileCommon object I googled and found some workarounds:

  • How to Get List of User/Profile from Membership Provider?
  • How to assign Profile values?
  • "The name ProfileCommon does not exist in the current context"
  • http://forums.asp.net/t/1487719.aspx/1?profile+common+non+existant+in+ASP+NET+4+0+
  • http://weblogs.asp.net/jgalloway/archive/2008/01/19/writing-a-custom-asp-net-profile-class.aspx

And so on. But nobody said that I have a ProfileCommon object at run-time. Here’s my example:

<profile enabled="true">
  <properties>
    <add name="AdminRemark"/>
    <add name="FacilityID" type="System.Int64" defaultValue="1"/>
  </properties>
</profile>

This line compiles well and works, but I have the hard-coded property name:

rcbFacilityID.SelectedValue = 
    (ProfileBase.Create(userCurrent.UserName) as ProfileBase)
    .GetPropertyValue("FacilityID").ToString();

But this line doesn’t compile and gives the error: The type or namespace name ‘ProfileCommon’ could not be found (are you missing a using directive or an assembly reference?)):

rcbFacilityID.SelectedValue = 
    (ProfileBase.Create(userCurrent.UserName) as ProfileCommon)
    .FacilityID.ToString();

But at run-time I tried to execute the line in the Visual Studio Watch window and it worked! It event displayed the type of ProfileBase.Create(userCurrent.UserName) as ProfileCommon without the cast. Intellisense didn’t work, but a could inspect the object and I saw that it had both profile properties defined.

I don’t mind working with hard-coded profile property names if it’s the only way except the custom ProfileCommon class, but I’d like an explanation why the ProfileCommon class is available at run-time and not a compile-time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:16:06+00:00Added an answer on May 26, 2026 at 5:16 am

    ProfileCommon is not available at compile time because it is a class created when the application is started. This is due to the properties you can define inside the profile element in web.config so they can be dynamically added.
    See the remarks in the official documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application project (wap) that is successfully being deployed to a
I have a web application project that works with a quite large database (over
I am starting a web application project that will have an Adobe Flex front-end
I have a Web Application project in Visual Studio 2008. (lucky you, you say?
I have a web application project. I am trying to find out why certain
I have a freelance web application project where the client requests new features every
I have an ASP.NET web application project which references another project called ModusCore (or
We have a pretty big ASP.NET WebForm (web application) project with a lot of
Do you have one solution with the web application project, class libraries, database project
Currently we're using Web Application project, so we have a gain with compilation. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.