“Go To Definition” in Visual Studio only brings up

2019-01-16 08:02发布

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?

24条回答
叛逆
2楼-- · 2019-01-16 08:29

I've kill all VS instances, deleted the SUO, launch sln and it worked for me...

查看更多
Juvenile、少年°
3楼-- · 2019-01-16 08:30

Looks like it needs to be setup in Resharper as well. My Visual Studio does not navigate to .NET Framework source code until I enable it in Resharper.

Resharper settings to allow navigate to external source

查看更多
走好不送
4楼-- · 2019-01-16 08:31

Well, another developer found the answer. The specific project we had an issue with was originally added as a file reference, then removed and added as a Project Reference. Visual Studio however, kept both in the csproj file for the web site, causing the issue. He went in and manually edited the csproj file to remove the file reference to the problem project and all is fixed now

查看更多
地球回转人心会变
5楼-- · 2019-01-16 08:31

1. close your solution.

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

3. open your solution.

4. rebuild your solution.

查看更多
放我归山
6楼-- · 2019-01-16 08:31

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
查看更多
We Are One
7楼-- · 2019-01-16 08:32

For me, the GUID solution didn't work and I couldn't find my .ncb file. (Or maybe I'm lazy and didn't look hard enough, but that's not important.) Rebuilding and restarting visual studio didn't help either.

What I did was close visual studio and delete the .dll and .pdb being referenced in the top of the Meta Data file that my intellisense kept linking to. In my case it meant I deleted my .dll and it's .pdb file from Utilities/bin/Release. (Utilities is the name of the .dll project I was having issues with.) Then I restarted visual studio and rebuilt the .dll then the whole solution. No more problems!

查看更多
登录 后发表回答