ProfileCommon could not be found - WEB SITE project

Posted on 2010-04-08
Medium Priority
Last Modified: 2013-12-17
Within a WEB SITE project (not a Web Site Application) in VS2008, the following line

ProfileCommon profile = HttpContext.Current.Profile as ProfileCommon;

keeps throwing the error 'The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive...'

I'm using System.Web.Profile;  in VS2008 Standard with .NET 3.5

I understand that ProfileCommon is dynamically created but how do I stop the error?

Thanks for your help.

Question by:philwill4u
  • 3
  • 2
LVL 41

Expert Comment

ID: 30121956
make sure you have enabled the profile in webconfig:
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider">

Author Comment

ID: 30151026
That's in place but still getting the same error.


Author Comment

ID: 30160020
I've figured it out.... and what a strange result....

in the web.config I had...

   <!-- ensures that we can use both C# and VB class files int he APP_Code folder --><add directoryName="CS"/>

Accepted Solution

philwill4u earned 0 total points
ID: 30160232
Sorry... hit the wrong key.

      <!-- ensures that we can use both C# and VB class files int he APP_Code folder -->
   <add directoryName="CS"/>
   <add directoryName="VB"/>

This was there so that I could deploy some old VB classes in the App_Code directories under /VB and /CS

When I removed this completely, the code compiled without error.  ProfileCommon was no longer an issue during compilation.

Beats me why this is the case but the problem is solved.

LVL 41

Expert Comment

ID: 30210462
Interestingly strange result...

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question