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

后端 未结 26 2717
夕颜
夕颜 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:10

    Symptom:

    Visual Studio 2010 Ultimate was repeatedly failing to find references to functions, #defines, includes, etc when using the "Go To Definition" or "Go To Declaration" or "Find All References" features - oddly Intellisense was working.

    Fix:

    1. Close Visual Studio
    2. Delete (rename if you want to be conservative) the solution .sdf file
    3. Reopen Visual Studio

    The .sdf file will automatically be rebuilt by parsing the include files in your solution

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

    Below steps worked for me.

    1. Go to .csproj file
    2. Open it in Notepad Go to line where dll is referred.<Reference Include="">
    3. Delete the line

      <SpecificVersion>False</SpecificVersion> 
      or 
      <SpecificVersion>True</SpecificVersion>
      
    0 讨论(0)
  • 2020-12-07 14:15

    #1

    Check "View - Object Browser" and if you see more than one assembly with the same name - that's why your getting this error.

    For us it was a bug in VS 2019:

    If you have ASP.NET "Razor helpers" in App_Code folder the Visual Studio 2019 interprets that as a different assembly but with the same name, that hides the actual assembly.

    There's no fix for that other than rewrite those helpers to partial views or HTML helpers (you will have to do that anyway if you plan migrating to .NET Core).

    See this workaround on MS's site and please upvote the bug there so MS fixes it

    https://developercommunity.visualstudio.com/solutions/1008795/view.html (please upvote)

    #2

    Another reason why same assembly can be loaded twice in the object browser is if you have a unit-test project that starts iis-express process and never kills it properly.

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

    1. close your solution.

    2. delete hidden <name of the solution>.suo file in folder where your solution's <name of the solution>.sln file exists.

    3. open your solution.

    4. rebuild your solution.

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

    I did all suggested steps but nothing has been changed then
    finally right click and add reference menu, project tab

    1. simply unselected the reference project.
    2. save the solution.
    3. select the same project.
    4. Rebuild the solution.

    Problem sorted. Hope this will help to some one.

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

    After deleting dll files from Visual Studio first and adding them back manually from Solution Explorer --> Website --> Add --> Reference and enabling 32-bit Applications in IIS fixed it for me.

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