I am getting an error when trying to publish the symbols:
Symbol indexes could not be retrieved.
Can you please describe in more detail what you're attempting to do? (For example, as I understand it, you should consume the symbols, not publish them. What location are you publishing to?)
Thanks for the quick answer! To be honest, I am not sure what is going on under the hood. I am using a TFS build that has a step "Index sources & publish symbols". That step was working with my previous moq dependency (4.7.1) and not anymore. I will try to find out more about what it is trying to do.
I'm wondering why TFS would even attempt to source-index a third-party dependency's PDBs.
The change here (as mentioned in the changelog) is that Moq 4.7.99 now includes PDBs again (for the first time since version 4.5.7), and they are already source-indexed. The PDBs are of the new "portable" variety btw., perhaps you are using an older release of TFS that doesn't understand them yet?
Some options that I can think of:
I will check that, I wonder indeed why it does not only work on my component pdb.
@epot: Possibly because your component uses the classic PDB format (full or pdb-only)? Moq uses the relatively new portable PDB format. (The people at Microsoft clearly say that there are many tools that don't understand this new format just yet, but from their standpoint it's "the future" and that's where they invest all their efforts.)
Btw. I edited the above answer and added some more options for you to try.
I am also getting the same issue with a hosted build in team services online
I have downgraded moq in the meantime
It looks like to be a standard build step to try to retrieve the symbols from the 3rd parties pdb (for instance, another component causing an issue: https://github.com/sendgrid/sendgrid-csharp/issues/494). I think I will also downgrade for the time being.
As suggested in this comment over at sendgrid/sendgrid-csharp#494 and on the condition that SourceLink supports the classic PDB format, I might also change the .NET 4.5 target's PDB back to <DebugType>full</DebugType> so you can upgrade again (if you want :-). Or as an alternative, add a separate net471 target for the portable, source-linked PDB.
I'll monitor the referenced issue to see how it resolves.
+1 I hit this tonight. I backed off to the previous version and the build is working just fine for now. I will keep an eye out for a new version that works with VSTS and .Net 4.5.
Thanks
Unfortunately we cannot resolve this issue like the Sendgrid folks did, because we're source linking the Moq PDBs, and SourceLink isn't supported yet for classic / Windows PDBs. This will change with Roslyn / VS 15.3, see https://github.com/dotnet/roslyn/pull/18539.
We have about three options on how to proceed:
Remove the PDBs for the .NET 4.5 target until Microsoft's own tooling has better support for portable PDBs. Who knows how much longer that is going to take.
Revert from SourceLink to GitLink for the .NET 4.5 target. That would be unpleasant because Moq's GitLink setup was never verified as working, so this would possibly be much work for only a temporary gain. (Edited: This wouldn't help any since no matter what tool we use, if we end up with a portable PDB, TFS is going to complain.)
Wait until Roslyn 15.3 is out, then switch to a full Windows PDB (instead of portable PDB) for the .NET 4.5 target, recompile with Roslyn 15.3 and republish.
My personal preference is option (3). Any thoughts?
We've just run in to this same issue. Now that 15.3 has been released is this back on the radar to move over to Windows PDBs?
@rh072005 - only just updated to VS 2017.3. I'll look into it over the next few days. This should be doable if @ctaggart's SourceLink tools work for Windows PDBs.
@epot, @Magrangs, @gregveres, @rh072005 - I have prepared a potential fix for your issues (switching from portable PDBs back to classic PDBs, see the PR referenced above), but I can't actually test it as I don't have access to TFS. Would any of you be willing to test an out-of-band, prerelease version of Moq (4.7.100-pre, temporarily available here) and see if it resolves your issues?
@stakx I've just given that a go and it's working for us
OK this should be fixed by #443 in the next release of Moq (version > 4.7.99).
It would be a pity if Moq had to remain with classic PDBs forever, I guess we'll make the switch back to portable PDBs sometime in the future (perhaps in 2018). Until then let's give the new portable PDB format some more time to gain momentum and better tooling support.
I had the same issue, thanks for correcting it :) When is next released planned ?
@TechWatching: I am still waiting for feedback on one or two issues, but I was looking at publishing an updated version of Moq in the next 2 weeks or so.
Just for those of you still watching this issue, version 4.7.127 is out. Back to Windows PDBs, hope this helps.
Most helpful comment
Just for those of you still watching this issue, version 4.7.127 is out. Back to Windows PDBs, hope this helps.