Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:37:31+00:00 2026-06-11T15:37:31+00:00

I have brought in some old (not my own) code to a new solution

  • 0

I have brought in some old (not my own) code to a new solution which I want to modify. I am new to C# so I apologize if my terminology is incorrect or have missed anything obvious.

I have a main form MainForm.cs and custom component CustomComponent.cs which inherits the PropertyGrid. The CustomComponent is within the MainForm.

I am getting an error:

The type name 'MainNameSpace' does not exist in the type 'MainNameSpace.MainNameSpace'

Within MainForm.Designer.cs I have the generated code:

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
    {
        // stuff
        this.customComponent1 = new MainNameSpace.MainNameSpace();
        // more stuff
    }

If I manually go in and change it to just “new MainNameSpace();” it works just fine. I don’t know why the name of the namespace is added twice. I tried checking the .resx file for anything suspicious but didn’t see anything, not that I’d know what to look for. Is there a good starting place to look? I’ve gone into the MainForm, CustomComponent, and everything else I can think of looking for the culprit but have not found anything that looks like the culprit. Any ideas as to where I should be looking/what to look for? I feel like the issue is in CustomComponent.cs but I do not know.

CustomComponent.cs:

namespace MainNameSpace
{
    public partial class MainNameSpace : PropertyGrid
    {
        public MainNameSpace()
        {
            InitializeComponent();
        }

        // other stuff
    }
}

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:37:32+00:00Added an answer on June 11, 2026 at 3:37 pm

    I have had this problem before and I am pretty sure that it is with these lines:

    namespace MainNameSpace
    {
        public partial class MainNameSpace : PropertyGrid
        {
    

    The namespace and class cannot have the same name because it doesn’t know which one you are calling. Try changing either the namespace or class name and it should work.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some client code which is using the SqlConnection class in .NET to
I have been working on some code, which I use git to manage. Earlier,
I have a form that is brought up in a ajaxed modal which I
I have some friends who are 'old-school' VB6 database developers and I was telling
I want to develop facebook applications and I have bought some books from amazon.
I have some code I've been using to get the current keyboard layout and
Hey i have a situation in which i need to pass some variable value
I have the following problem. I use an old Windows XP laptop as some
I have an application that does some image processing on each new frame, recently
So I brought the django-polls tutorial into a simple blog. Some posts have polls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.