Results 1 to 8 of 8

Thread: Trouble with the <profile> element's inherits attribute

  1. #1
    njsokalski is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2011
    Posts
    102
    Reputation
    31

    Trouble with the <profile> element's inherits attribute

    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.
    Nathan Sokalski

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,209
    Reputation
    2369
    This is a VB.Net forum, try for example this for C#: C# Developer Forums

  3. #3
    njsokalski is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2011
    Posts
    102
    Reputation
    31
    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?

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,209
    Reputation
    2369
    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.

  5. #5
    njsokalski is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2011
    Posts
    102
    Reputation
    31
    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.
    Nathan Sokalski

  6. #6
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,209
    Reputation
    2369
    Do you also get this C# compiler error in local debugging?

  7. #7
    njsokalski is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2011
    Posts
    102
    Reputation
    31
    No, in local debugging I do not get an error at all.
    Nathan Sokalski

  8. #8
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,209
    Reputation
    2369
    I would then say there is no problem with your app, but a problem with IIS configuration at server.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking