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 5972579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:40:40+00:00 2026-05-22T20:40:40+00:00

I am using VS2010 SP1. After creating a demo project for C# Form application,

  • 0

I am using VS2010 SP1.

After creating a demo project for C# Form application, my solution structure has the following information

Form1.cs
   Form1.Designer.cs
   Form1.resx

// File Form1.cs
namespace WinFormApp
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }
  }
}

// File Form1.Designer.cs
namespace WinFormApp
{
  partial class Form1
  {

    private void InitializeComponent()
    {
      ...
    }
    ...
   }
}

Here is the question,
I can see the Form1 is a partial class. However, how does the compiler know where to find the another part of it? *In other words, is there a binding between the file Form1.cs and Form1.Designer.cs?* Here, as you can see, the other part is defined inside Form1.Designer.cs. I assume there are hints out there so that the compiler can quickly find all implementation code for a partial class. Please correct me.

Thank you

  • 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-05-22T20:40:41+00:00Added an answer on May 22, 2026 at 8:40 pm

    The C# compiler is a “two pass” compiler. The project system gives the compiler a list of all the files in the project. The compiler first does a “top level” scan of all the files, and builds up a table of which files contain which namespaces, types, methods, properties, events, fields, and so on, but it does not look at method bodies.

    When that table is built up we can use it to do “top level” checking of the entire program. We figure out at that time which partial declarations are really “the same class”. During this stage we resolve partialness, we resolve base types and constraints on generic parameters, we make sure that all “override” methods actually override a matching virtual method, and so on.

    Once the “top level” analysis is done, only then do we analyze the method bodies.

    The file names are irrelevant; the compiler only uses them for error reporting. It is perfectly legal to have a dozen classes and a hundred files and a partial declaration of each class in each file. (Though please do not actually do that; it increases the burden tremendously on the IDE when people do stuff like that because it becomes difficult for us to figure out quickly what all the members of a class are while you are typing in changes!)

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

Sidebar

Related Questions

Using a VS2010 SP1 Data-tier application project, I created the simplest database I could:
I'm running VS2010 SP1. We want to create a project using SQL Server Compact
I am using VS2010 C#.NET 3.5 and application settings (the Settings.settings file). What I
I'm using MVC2 with VS2010 I have a view that has two partial views
Is anyone using ClickOnce with VS2010? I’m getting the following on publish, when the
I have installed VS2010 and MVC2 and testing a simple form using tinyMCE. When
Im using VS2010, C# 4.0, NHibernate and NUnit in a project Im working on..
The following code compiles with gcc 4.5.1 but not with VS2010 SP1: #include <iostream>
I have been trying to install VS2010 SP1. I have tried Using both the
i am using vs2010 and whenever i build any windows application (not using mfc

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.