vs2010 F12 does not take me to class definition

Posted on 2012-08-22
Last Modified: 2012-08-29
If I highlight a class and press the F12 key it brings me to its definition. If the class is in a differnt Project it displays the object browser. My solution contains both projects. Is there any way to display its definition even though its in a different project?
Question by:glenn_r
    LVL 83

    Expert Comment

    How do you reference the other project? Did you add a project reference or an assembly reference? I think this would happen if you added an assembly reference.
    LVL 40

    Accepted Solution

    If you simply 2 projects in Visual Studio, their source code is not linked by default. They are 2 different projects that you simply wanted to load in 1 shot when opening the solution.

    When you press F12, it works only on the source code available to the current project.

    In order to "link" the source code of one project to the other and have F12 see both when activated, the project in which you press F12 needs to reference the source code of the second project. By default, references are made to the compiled assembly, not the source code.

    To have the behavior that you want, you must first remove the already existing reference in the References window. Then, recreate the reference, but be careful to select the referenced project through the Projects tab of the window instead of the .NET or Browse tab.

    That approach can lead to problems however if you work in an environment where another programmer might be working on the source code of the referenced project at the same time as you are.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now