I'm trying to track down a WCF issue, and something that would help would be to break into the framework source. I already found the section in the .net reference source that I want to step into, but the challenge is that I can't see to get the debugger to step into the code for System.ServiceModel. I've followed the steps outlined here for setting up VS (although in my case I'm on 2019 enterprise). I tried this:
var d=new Dictionary<int, int>().TryGetValue(3, out int x);
And was able to step into TryGetValue in mscorlib.dll, but this:
NetTcpBinding tcpBinding = new NetTcpBinding(SecurityMode.TransportWithMessageCredential);
BindingElementCollection outputBec = tcpBinding.CreateBindingElements();
Won't let me step into either the NetTcpBinding constructor or the CreateBindingElements method, which I know exists in the reference source.
The modules window shows that System.ServiceModel.dll is loaded from:
"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll",
and that the symbols are loaded from:
D:\SymbolCache\System.ServiceModel.pdb\0811c462ccbb4a418946598a612f96cd2\System.ServiceModel.pdb 6 4.8.3825.0 built by: NET48REL1LAST_B 5/31/2019 9:51 PM
I did notice that for mscorlib.dll the version was coming back as "4.8.3815.0 built by: NET48REL1LAST_C", but I'm not seeing any prerelease .net 4.8 versions installed. I've also tried disabling all symbol sources except for http://referencesource.microsoft.com/symbols, and clearing the symbol cache.
So at this point I have two questions:
1-Is there something else I should try to get .net reference source stepping to work in this case? I suspect a version mismatch, but the reference source pages don't specify the exact versions of assemblies that they're for.
2-Is there a way to verify the assembly version number from a C# PDB file? I have the PDB that I cached from the reference source, but I can't tell which assembly version this maps to.