Question Trouble with the <profile> element's inherits attribute

njsokalski

Well-known member
Joined
Mar 16, 2011
Messages
102
Programming Experience
5-10
I have an ASP.NET Web Application in which I want to use profiles. In my Web.config file, I have the following:

<profile enabled="true" inherits="mckeepottery_com.MPProfile" defaultProvider="McKeePotteryProfileProvider">

And I have a file in my application (which is named mckeepottery_com) that declares a class as follows:

Public Class MPProfile : Inherits System.Web.Profile.ProfileBase

But when I run my application, I receive the following error:

CS0246: The type or namespace name 'mckeepottery_com' could not be found (are you missing a using directive or an assembly reference?)

I have tried adding mckeepottery_com to the namespaces section of the Web.config section, and I am able to access MPProfile from all my codebehind classes, but nothing that I could find would stop this error. Is there something else I need to add to the Web.config or something else I need to do? I have spent hours searching, but none of the suggestions seemed to help. Any suggestions would be appreciated. Thanks.
 
I know this is a VB.NET forum, but I posted my question to the section on Web Configuration, and my ASP.NET site was created using VB.NET (not C#), and the problem has to do with the Web Configuration file being unable to find the class I wrote (using VB.NET). How is my problem not appropriate for the ASP.NET Web Configuration section of a VB.NET forum?
 
CS0246: The type or namespace name 'mckeepottery_com' could not be found (are you missing a using directive or an assembly reference?)
I have yet to see VB.Net project yield a C# compiler error.
 
Well, you've seen it now, because my code was written and compiled in VB.NET, I uploaded the *.dll to the my site with the Web.config and other code, and this is the error displayed when I attempt to view the page in the browser. Maybe something else on the server that I am unaware of (the server is a web hosting service I pay for, so I can't see everything and every setting in IIS) is causing it to give a C# error, but remember that the error is in the Web.config having to do with the inherits attribute of the <profile> tag, not the class itself.
 
Do you also get this C# compiler error in local debugging?
 
I would then say there is no problem with your app, but a problem with IIS configuration at server.
 
Back
Top