ProfileCommon could not be found - WEB SITE project

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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

make sure you have enabled the profile in webconfig:
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
philwill4uAuthor Commented:
That's in place but still getting the same error.

philwill4uAuthor Commented:
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"/>
philwill4uAuthor Commented:
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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Interestingly strange result...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.