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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:40:12+00:00 2026-06-17T16:40:12+00:00

I know that this is really not a smart question, but I have some

  • 0

I know that this is really not a smart question, but I have some trouble understanding some working of Visual Studio 2010.

Programming a Windows form I needed to move a class (let’s say: class x) in a source (let’s say: a x.cs) file that was included in the main namespace and assembly to a different project (and assembly) in a different namespace. The latter is a dll aimed to gather utility classes. Probably I did this in a wrong way.

Symptoms is: When in the main form (code, not design) pressing F12 with the mouse over the constructor of the X class results in a new source “from metadata” being shown, including a class declaration (but still I can open the source code clicking on the right mouse button and selecting “show source code”). It seems that VS is unable to find the proper source code in the solution.

My questions:

  1. How can I recover from this having F12 points to the proper methods?
  2. More in general, what is the correct method to move code within different projects and/or assemblies?
  • 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-17T16:40:13+00:00Added an answer on June 17, 2026 at 4:40 pm

    I’ve just had a go at duplicating the described issue but it’s working fine for me. Let me describe the steps I took and maybe you’ll spot where you have done something different.

    1. Create new solution.
    2. Add new Windows Forms application called FormsApp. This gives me a form called Form1 with a default namespace of FormsApp.
    3. Created a class called Util in a file called util.cs in the FormsApp project. It gets the same namespace of FormsApp.
    4. If I create an instance of the Util class in the Form1 constructor, I can hit F12 to be brought to the definition of Util as expected.
    5. Created a new Class Library called Utility in the solution.
    6. It’s possible to move files a number of ways but I just clicked on the util.cs file in Solution Explorer and dragged it down to the Utility project. This will copy the file but leave the original in place. Maybe you’ve copied your files differently?
    7. When the original is deleted, you should get a build error if you try to compile. This is to be expected since the FormsApp project doesn’t know anything about the Util class in the newly-added Utility project.
    8. Add a reference to the Utility project in the FormsApp project in Solution Explorer.
    9. If you try to build now then it should succeed. Pressing F12 in the Form1 constructor brings me to the definition of the Util class as expected even though I didn’t change the namespace of the Util class.

    If it helps clarify things, here are a few images:

    Solution Explorer:

    Solution Explorer

    Form1 Constructor:

    enter image description here

    Util class:

    enter image description here

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

Sidebar

Related Questions

i didn't really know how to title this question, but here's a thing that
Yes, I know that the FAQ pretends to answer this, but it doesn't really.
I know that this sort of question has been asked here before, but still
I know that this question must have been asked and answered a million times,
I know that this is a newbie question but I am a newbie so
There is probably a simple answer to this question but I do not have
I know about this question , but I have the source and I'm having
I really don't know how to ask this question or title it but here
I have a really strong feeling that this question will either be closed or
I must admit that I don't really know if this is the right place

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.