Visual Studio 2010 Solution Find all References Not Working

半城伤御伤魂 提交于 2019-12-12 10:49:43

问题


I have a Visual Studio 2010 Solution that was imported from a Visual Studio 2008 solution that the Find all References does not work on. I've tried doing some searches on Google to try and figure this out but have come up empty handed.

The find all references in VS2008 worked like a charm, we upgraded to 2010 and now no matter what file I'm in the Find All References doesn't return anything.

Anyone have any idea how to possibly fix this or some good ways to "debug" the issue.


回答1:


I figured out what it was. I was still running the Beta version of the Web Deployment Project code template. Just had to un-install it and download the RTW version and everything was fine.




回答2:


May be framework mismatch with your project.

for e.g. suppose your project in F2.0 and VS10 providing it F4.0 reference.




回答3:


I was having this same issue. I found that if you look in the OUTPUT window, change "Show output from" dropdown list to "REFACTOR" and you may see an error that occurred when looking for references.

In my case i was getting "Not enough memory" error related to some bug with Telerik.dll.




回答4:


I haven't come across this specific problem, but I have had a good few odd few Visual Studio behaviours in the past (2005/2008/2010) that were fixed by doing a full reset of all the VS settings.

Occasionally the settings seem to get corrupted and things stop working:

Tools -> Import & Export Settings -> Reset All Settings

A bit of a long shot - but give it a go.

Additionally, this article details the changes in "Find All References" between 2008 and 2010. I'm not sure if this may shed any further light on your issue, but I thought it worth highlighting.




回答5:


Before your reset all of your settings, try this...

I had a similar issue and traced it to missing DLLs in the obj\Refactor folders. I wrote this VB script (which I saved as reff.vbs in one of the folders from my path environment variable) and run it from a command prompt. When "Find All References" or "Refactor > Extract Method" fails, rebuild your solution, then run this:

'' reff.vbs ''
Dim refFile, wsh, objFSO
Set wsh = CreateObject("wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")  
RefactorFolders "c:\Source" '' Put your root source folder here
Set objOutputFile = objFSO.OpenTextFile("RefreshRefactor.bat", 8, True)
objOutputFile.WriteLine(refFile & "")
objOutputFile.Close
wsh.Run "RefreshRefactor.bat", 1, True
Set wsh = Nothing
Set objFSO = Nothing 

Sub RefactorFolders(strFolder)  
    Set objFolder = objFSO.GetFolder(strFolder)  
    For Each SubFolder in objFolder.SubFolders  
      If Right("         " & SubFolder.Path, 9) = "\Refactor" Then
        Set objBinFolder = objFSO.GetFolder(Left(SubFolder.Path _ 
            , Len(SubFolder.Path) - 8))
        Set files = objBinFolder.Files
        For Each binFile In files
            chk = Right("    " & binFile.Path, 4)
            On Error Resume Next
            If chk = ".exe" Or chk = ".dll" Or chk = ".pdb" Then 
              refFile = refFile & "copy /y """ 
              refFile = refFile & binFile.Path & """ """ 
              refFile = refFile & SubFolder.Path & "\"" "
              refFile = refFile & vbCrLf 
            End If
            On Error Goto 0
        Next  
      End If
      RefactorFolders SubFolder.Path
    Next 
    Set objFolder = Nothing 
End Sub


来源:https://stackoverflow.com/questions/3070878/visual-studio-2010-solution-find-all-references-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!