Given:
Then when debugging, VisualStudio will search for source code in "A", will not find it (as it is in "B"), and will display the dialog called "Find Source". Then you will browse to the correct location of source file, and everything will work fine.
In order to avoid this dialog to appear (and its associated browsing), is there a mean to have Visual Studio automatically look for source code in "B" ?
It seems that you have set some configuration related to debugging in project.
This property page specifies where the debugger will look for source files when debugging the solution.
To access the Debug Source Files property page, right-click on your Solution in Solution Explorer and select Properties from the shortcut menu. Expand the Common Properties folder, and click the Debug Source Files page.
Directories containing source code
Contains a list of directories in which the debugger searches for source files when debugging the solution.
Do not look for these source files
Enter the names of any files that you do not want the debugger to read. If the debugger finds one of these files in one of the directories specified above, it will ignore it. If the Find Source dialog box comes up while you are debugging and , you click Cancel, the file you were searching for gets added to this list so that the debugger will not continue searching for that file.
It is possible to automate the source code search using the autoHotKey scripting tool: it will open nicely the correct source code without any user input. The first time a file is search, it will take a few seconds, and then it will become instant.
The script code is provided below. It's used with VS2010:
SourcesRoot = D:\MySourceCodeIsHere
Loop
{
WinWait, Find Source:,
IfWinNotActive, Find Source: , , WinActivate, Find Source:,
WinWaitActive, Find Source:,
ControlGetText, Filename, Edit1,
Loop, %SourcesRoot%\%Filename%, , 1
{
ControlSetText, Edit1, %A_LoopFileFullPath%
break
}
ControlClick Button2
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With