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 Meta data file instead of going to the source.
Some Points:
- All the source code is C#, there is no VB.Net
- All the projects are in the same solution
- Yes, everything is a project reference (checked and double-checked)
- I have tried the Clean/Rebuild Solution approach (even to the point of clearing out the Temp directory, Temporary ASP.NET Files directory, etc).
Has anyone else seen this behavior and/or know how to fix it?
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.
For those using VS 2017 (I'm at version 15.3.4 at this moment) here are the simple steps:
.vs\[your solution name]\v15
.suo
fileThat fixed it for me: F12 opened the actual source file, not the "from metadata" version.
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:
The .sdf file will automatically be rebuilt by parsing the include files in your solution
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...
Remove the reference dll, Build (will get errors), ADD THE reference (you removed) then build again ... F12 on your function should then work (worked for me).
Below steps worked for me.
<Reference Include="">
Delete the line