“Go To Definition” in Visual Studio only brings up the Metadata

后端 未结 26 2718
夕颜
夕颜 2020-12-07 13:33

I am working in a Web Project in Visual Studio 2008. When I hit F12 (or right-click and select Go To Definition) Visual Studio is consistently going to the Metadata file in

相关标签:
26条回答
  • 2020-12-07 14:02

    This one worked for me:

    1. Right click the dll in the reference folder in your solution explorer
    2. Remove dll file
    3. Right click the Reference folder, then
    4. Add reference to the dll file again
    0 讨论(0)
  • 2020-12-07 14:04

    It happens when you don't add reference as a project but point to a dll or exe using Browse tab in Add Reference dialog. If you add reference using Projects tab you should go directly to the source code when you select Go To Definition.

    However, if you install ReSharper, you'll go to source code even if you added your reference to a dll/exe using Browse tab.

    0 讨论(0)
  • 2020-12-07 14:05

    Just found another cause. I upgraded my web project to 4.0 but left the class libraries at 2.0. At that point all the class libraries in my solution were treated as file references from my web project. Might help someone else...

    0 讨论(0)
  • 2020-12-07 14:05

    I faced the same issue and one of colleagues gave me the following solution and it worked! If none of the above works for you,

    1. Remove all the references and add them back (make sure the path is correct)
    2. Go to Solution properties, and recheck the Project Dependencies of all projects. Make sure the project that you'll be using is added as a dependent in the project that you are working on.
    0 讨论(0)
  • 2020-12-07 14:05

    This can happen if you're trying to jump to the definition in a project that has been unloaded (Unavailable). Right-click the unloaded project and select "Reload Project".

    0 讨论(0)
  • 2020-12-07 14:06

    Visual studio often suffer from a problem of going to metadata rather than your project if you shift location where you are building the project, ie you may have several versions to test things out.

    Simply delete the reference and immediately add it back and everything will be sorted out.

    0 讨论(0)
提交回复
热议问题