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.

philwill4uAsked:
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.

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

0
philwill4uAuthor Commented:
I've figured it out.... and what a strange result....

in the web.config I had...

<codeSubDirectories>
   <!-- ensures that we can use both C# and VB class files int he APP_Code folder --><add directoryName="CS"/>
                  </codeSubDirectories>
0
philwill4uAuthor Commented:
Sorry... hit the wrong key.


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

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.

0

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
guru_samiCommented:
Interestingly strange result...
0
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.