Configuring Visual Studio Source Server / Symbol Store against unsupported Vault SCM app - debugging

I am trying to configure our in house development code as a symbol server, with source control file access when debugging in Visual Studio 2008. We can use this on other projects that reference our core set of libraries.
Sadly, we use SourceGear Vault for our SCM system, which is currently unsupported when it comes to indexing our .PDB files with their source control references.
I wouldn't really need direct source control access, I'd be happy with just a network share access but I can't see how to update the references in the PDB files.
I have the symbol server configured and have added what would seem the right references to the original build source code, however, when I debug in Visual Studio and try and step into the code referenced, it does not load the PDBs from the source server and consequently no source code is available.
Also, where Visual Studio can download the core .NET PDB files via the Load Symbols command, I do not have that option when I click the module.
Does anyone have any personal experience of setting this sort of thing up?
Many thanks if anyone can help.

This issue has kind of been resolved at this other related question.
Source indexing was missing from the overall process so the PDB symbol server should work properly now.

Related

Vs2017 Source Not Available

I´m trying to debug a System.Net.Http.Formating.dll, by clicking at the stack trace:
System.Net.Http.Formatting.dll!System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStreamAsync.AnonymousMethod__c()
I´ve the "Just my code disabled" and I have the following symbols servers:
https://nuget.smbsrc.net
http://localhost:33417/ (dot peek)
Microsoft Symbol Server
I do have the pdb available, however I get the following error/image.
How to properly overcome it?
Why is it such a hassle to debug third party source code at Visual Studio?
After following the link pointed by #Jack Zhai-MSFT I was finally able to understaand the reasons why the .net framework couldn´t be debugged.
It turned out that the symbols were being downloaded without their respective source, because I was pointing to Microsoft Symbol Server instead of http://referencesource.microsoft.com/symbols
Then, my following attempt was to uncheck the "Microsoft Symbols Server" or to change the order at the Symbols menu. To my surprise, I couldn´t delete it, nor change the order, and, even after it was disabled the symbols were still fetched from there.
Perhaps this is a VS2017 community bug.
What I did next, that actually solved it:
Deleted my symbol cache that had misleading pdbs without source
Enabled just my code flag, disabling “Enable .NET Framework source stepping” and started the app, on debug mode
Paused at a breakpoint in which, at the stack, I had access to the code I wanted to debug
Double clicked such stack, and then hit Load Symbols.
This time around, for some reason, the Microsoft Symbol Server was skipped, and the right pdbs were downloaded
Note that, still, I couldn´t download some "optimized symbols" like system.net.http, but I´ll try to figure that out next
Also, I setup the symbols servers using that as a reference, which helped me to promptly get any third party symbols (Except .net)
https://www.symbolsource.org/Public/Wiki/Using
EDIT:
With the help of dotPeeker I was able to get all the missing pdb files by:
Loading these dlls into dotpeeker (ex: System.Net.Http)
Load one of the source files from that DLL
Hit Generate PDB and store it into the same cache folder as VS2017 uses
PHEW!! What a hassle for something that should have been trivial!
To debug third party source code, you could use the .NET Reflector or dotPeek with VS.
Reference:
Is it possible to actually debug 3rd party code using the source decompiled with dotPeek?
Update:
If you just want to debug the .NET source code, see: How do I debug .NET 4.6 framework source code in Visual Studio 2017?

Remote debugging Ax 2012 IL code

I'm trying to get remote debugging working to an AOS. But my breakpoints never get hit due to symbols not being loaded.
'Ax32Serv.exe' (CLR v4.0.30319: X++ IL App Domain): Loaded 'D:\Program
Files\Microsoft Dynamics
AX\60\Server\MyAOS\Bin\XppIL\Dynamics.Ax.Application.dll423.netmodule'.
Cannot find or open the PDB file.
I have my debugging symbols setup to:
\server\d$\Program Files\Microsoft Dynamics
AX\60\Server\MyAOS\bin\XppIL
But visual studio never loads the symbols into the cache.
I'm running Visual studio as Administrator
My client configuration settings are linked to the correct AOS
I'm connecting to the AOS with the AOS-account
I'm local administrator on the AOS server
Debugging options are checked on the server configuration
Any idea what I'm missing or not doing correctly?
Procmon is telling me that the devenv.exe process can't access below path (PATH_NOT_FOUND). But I'm clueless on why it's trying to access this path.
\server\d$\Program Files\Microsoft Dynamics
AX\60\Server\MyAOS\bin\XppIL\Dynamics.Ax.Application.dll33.pdb\63A38861AB9B4E6EA55578A367A991AD1\Dynamics.Ax.Application.dll33.pdb
According to my experience deployment of assemblies hinders a proper use of Remote Debugger at AOS side.
The following steps didn't help in my circumstances:
VS symbol cache set to a local path with PDB files (VS at a remote box caches a project from AOT).
VS symbol cache set to a shared folder (AOS PDB files are exposed to a network).
Attempts to find proper order of AOS restart / clean debug information in order to sync versions of loaded DLL and loaded PDB.
AOS option "Assembly hot-swap" didn't help either. It works, however PDB and DLL are not in sync.
Tinkering with DL3 / VSAssemblies AOS folders didn't reveal any workarounds.
Eventually it was found a possible way to overcome "Missing symbol information" message which is a root cause here in my opinion. There were a couple VS projects residing at AOT which were subject for remote debugging. Every attempt showed no luck due to the same "Missing symbol information" error.
I hope the following scenario could help OP to find a solution for AIF web service:
Append CSPROJ manifest with the following lines:
<VSProjectOutputFiles Include="$(OutputPath)$(AssemblyName).pdb">
<Visible>true</Visible>
</VSProjectOutputFiles>
This helps to save PDB artifacts into AOT tree.
Compile VS project at MorphX IDE. Compilation of project at AOT is essential here, as it deploys matching PDB alongside DLL.
Restart AOS. Hot-swap didn't worked for PDB, so restart is mandatory here. As a result you can see proper PDB within "Modules" window at VS and breakpoints are reachable now thanks to that fact.
Although using Remote debugger looks truly appropriate for AOS (not to bloat server with dev tools), it seems there are still some kinks in relation to AOS code deployment.

Attach sources to binary library in Visual Studio debugger?

In Eclipse, it's possible to "match" a zip archive (or a folder) containing sources to a compiled jar. This allows the debugger to do source-stepping on the associated sources with relatively low ceremony.
I'd like to do something similar in Visual Studio, given a dll, its associated pdb and the source code in some form.
The problem I'm trying to fix is that I'm creating a tools library that is delivered to QA in binary form and used in different projects (made of automatically generated code, FWIW). The QA engineers then need to be able to do source stepping inside the library method calls.
A related problem is, the QA engineer can't use "Go to definition" on a library method in the VS editor while not debugging.
For problem #1, the QA engineer currently needs to get the appropriate sources from the SVN server and manually specify their location to the debugger.
From what I can tell, in Visual Studio (and other debuggers) the traditional way is to use a symbol server which would provide both the pdbs and the sources, having only the library dll as input.
I know about SymbolSource.org - it uses 'NuGet symbol packages' (which I currently generate) but management won't agree to host off-site. I had a feeble attempt to set up their free source server offering locally, without much success.
So... is there an easier way (a la Eclipse)?

Break point not working and modules not loading dll files in VS 2010

I am using VS 2010 professional [64bit - Windows 7] and in my solutions, i have 3 class library project and 1 wcf service projects are there. All these dll's are refereneced in my WPF applications. For the last 1 year, it was working fine and i was able to debug the all the referenced projects. But from yesterday itself, debug is not working all of a sudden.
When I put a break point on a class in the wcf project, it says breakpoints cannot hit as the source file is different from....etc.
When I checked in the Debug --> Windows ---> Modules window, all those projects dlls are not seen there and says no pdb files are available ???
But in the WPF bin\Debug folder, i have all the referenced dlls and their pdb are ther.
What could be the problem ?
Even I am not able to debugg the wpf project as well. For getting break point or debug, each time i have to clean the solution or project then rebuild it again. Then i will be able to debug the WPF project.
In the case of referenced dlls, I removed the dlls and added the new compiled dll again and copied that pdb files to the wpf project exe folder. Still no use !!!!
I have changed the options in the Debug and Options [disabling and enabling the Just my code options etc]. But still it is not working.
This is not only my problem. One of my colleague also have this problem we took the whole latest solution code from TFS. SO I changed the Local code path to a new folder and took the latest code from TFS again. Still the problem exists !!
I am able to run the application. But debug is not working. In the WPF project, all those dlls are referenced properly.
Can anyone help us ???
I guess I don't have enough points to comment to ask specifics, so this may or may not solve your problem but I'll take a crack at it. Also, there appear to be other questions about this. So I would check those out first to see if they will help.
This question was solved by adding configuration to tell the program which version of the framework to use during debugging.
Why doesn't VS2010 debugger stop at my breakpoints?
Why does Visual Studio 2008 skip over my break points?
If those don't help, I'll give it a go.
When I put a break point on a class in the wcf project, it says breakpoints cannot hit as the source file is different from....etc.
This sounds like it could be one of the following issues:
Remote debugging and Visual Studio does not know where to load the symbols from or they are out-of-date
Need to clean and rebuild (which you seem to be doing)
The server you are running your WCF service on is not getting the updated DLLs and PDB files. If it's IIS Express, try killing the process between builds.
Also, make sure you are building in Debug mode and not Release mode. While building Release mode will generate the PDB files if it's set to do so which will allow you to debug an application, the code may be optimized as well which can cause breakpoints to be missed.

VS Studio 2010 Symbol Server Does Not Include Source Code

I have VS Studio 2010 SP1 installed and there was a time when source stepping was working great. Something has changed and now when the pdb files are downloaded they are the version that has the source code stripped out.
What I can't figure out is how to get VS to download the pdb files that have the source code in them. I have the same setup on 2 different machines and 1 machine downloads the pdb's with source and the other one does not.
I have been fighting for hours trying to get it to download the correct pdb files. I can easily check if the files are correct because the file size is so much smaller when there is no source.
Machine that is downloading with source System.Web.pdb size is 10,860 KB.
Machine that is downloading without source System.Web.pdb size is 843 KB.
Your help in figuring out this issue is greatly appreciated.
Also, please not I have cleared the cache, setup and reset the symbol settings, etc. The files download and do load as symbols, just NO source.
C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.pdb: Cannot find or open the PDB file.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\System.Web.pdb: Cannot find or open the PDB file.
C:\SymbolCache\MicrosoftPublicSymbols\System.Web.pdb\46C6DCE3C79A4E65A2B1CEF3033C95931\System.Web.pdb: Symbols loaded.
This behavior is often caused by Microsoft publishing updates to the .NET Framework.
When you use Visual Studio 2010's built-in default symbol configuration (by having "Enable .NET Framework source stepping" checked), you effectively query these two servers:
http://referencesource.microsoft.com/symbols
http://msdl.microsoft.com/download/symbols
No. 1 contains source-enabled symbols for the .NET Framework (parts of it at least) and no. 2 contains source-stripped symbols for all Windows.
The problem is that no. 1 is updated not as quickly as no. 2, so when an update arrives through Windows Update, you start getting symbols from no. 2, until someone at Microsoft updates no. 1. It's a pain, but that's how it is.
You can sort-of work around it by deselecting "Enable .NET Framework source stepping" and configuring those paths manually - then you can just disable (or not add at all) no. 2, and at least be informed, that there are no source-enabled symbols available yet.
Or you can disable Windows Update...

Resources