Type or namespace UserControls not found in RelayWeb

Posted on 2011-05-11
Last Modified: 2013-11-07
I get the error "The type or namespace name 'UserControls' does not exist in the namespace 'RelayWeb' (are you missing an assembly reference?)" This is an imported existing web project and I have tried adding references to RelayWeb (developed in-house). This ia a ASP.NET with C# 2008 DotNet 3.5 project that was converted from a ASP.NET with C# 2003 DotNet 1.1.

Please refer to screen shot attached.
Question by:Mister_Spock
    LVL 74

    Accepted Solution

    Can you show the line that generates the error?

    As a side note, folders in a .NET project, while most often times do, do not have to represent a namespace. Just because a folder with the same name as a namespace exists does not mean the namespace exists. You'll have to look at the namespace declarations of the affected files to see if the namespaces have been changed.
    LVL 3

    Author Comment

    The path is http://localhost/RelayV4/RelayWeb/Stub_Aliases_aspx_cs.cs if that helps. It was a project I converted from DotNet 1.1 to DotNet 3.5.
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    What do the namespace declarations look like in the files you are trying to access within UserControls? Do they have something like:
    namespace RelayWeb.UserControls

    Open in new window

    LVL 3

    Assisted Solution

    Here is what I found:

    Stub_Aliases_aspx_cs.cs is located in:        RelayV4\RelayWeb\App_Code\Migrated\Campaign\Stub_Aliases_aspx_cs.cs

    It has the Microsoft generated comments as follows:

    // This file was generated as part of an ASP.NET 2.0 Web project conversion.
    // This code file 'App_Code\Migrated\Campaign\Stub_Aliases_aspx_cs.cs' was created and contains an abstract class
    // used as a base class for the class 'Migrated_Aliases' in file 'Campaign\Aliases.aspx.cs'.
    // This allows the the base class to be referenced by all code files in your project.

    The abstract class mentioned in the comments is:

    abstract public class Aliases :  RelayBasePage



    The inheritied abstract class (RelayBaseClass) is found in:

    RelayV4\RelayWeb\App_Code\Config.cs and the class it inherits is System.Web.UI.Page

    public class RelayBasePage : System.Web.UI.Page

    The namespace in the RelayV4\RelayWeb\App_Code\Config.cs file creates is RelayWeb.

    RelayV4\RelayWeb\CAMPAIGN/Aliases.aspx.cs mentioned in the above comments has the using statement “RelayWeb.UserControls” and that is found just fine. The namespace is RelayWeb.Campaign.

    I hope this makes sense.
    LVL 3

    Author Closing Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now