Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Moq.pdb in version 4.7.99: "Symbol indexes could not be retrieved" #428

Closed
epot opened this issue Jul 18, 2017 · 18 comments
Closed

Comments

@epot
Copy link

epot commented Jul 18, 2017

I am getting an error when trying to publish the symbols:

Symbol indexes could not be retrieved.
@stakx
Copy link
Contributor

stakx commented Jul 18, 2017

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?)

@epot
Copy link
Author

epot commented Jul 18, 2017

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.

@stakx
Copy link
Contributor

stakx commented Jul 18, 2017

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:

  1. Exclude that PDB from the build step you mention, if that is an option.
  2. Add a build step that deletes the PDB after the NuGet restore.
  3. Downgrade to the previous release of Moq (which doesn't have any PDBs at all).
  4. Update TFS? (Just joking, that would probably be an insane amount of configuration work :-)

@stakx stakx changed the title Issue with Moq.pbd in version 4.7.99 Issue with Moq.pdb in version 4.7.99 Jul 18, 2017
@epot
Copy link
Author

epot commented Jul 18, 2017

I will check that, I wonder indeed why it does not only work on my component pdb.

@stakx
Copy link
Contributor

stakx commented Jul 18, 2017

@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.

@stakx stakx changed the title Issue with Moq.pdb in version 4.7.99 Issue with Moq.pdb in version 4.7.99: "Symbol indexes could not be retrieved" Jul 18, 2017
@mbx-mbx
Copy link

mbx-mbx commented Jul 18, 2017

I am also getting the same issue with a hosted build in team services online

I have downgraded moq in the meantime

@epot
Copy link
Author

epot commented Jul 19, 2017

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: sendgrid/sendgrid-csharp#494). I think I will also downgrade for the time being.

@stakx
Copy link
Contributor

stakx commented Jul 21, 2017

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.

@gregveres
Copy link

+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

@stakx
Copy link
Contributor

stakx commented Jul 30, 2017

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 dotnet/roslyn#18539.

We have about three options on how to proceed:

  1. 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.

  2. 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.)

  3. 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?

@rh072005
Copy link

rh072005 commented Sep 6, 2017

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?

@stakx
Copy link
Contributor

stakx commented Sep 10, 2017

@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.

@stakx
Copy link
Contributor

stakx commented Sep 16, 2017

@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?

@rh072005
Copy link

@stakx I've just given that a go and it's working for us

@stakx
Copy link
Contributor

stakx commented Sep 21, 2017

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.

@TechWatching
Copy link

I had the same issue, thanks for correcting it :) When is next released planned ?

@stakx
Copy link
Contributor

stakx commented Sep 22, 2017

@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.

@stakx
Copy link
Contributor

stakx commented Sep 25, 2017

Just for those of you still watching this issue, version 4.7.127 is out. Back to Windows PDBs, hope this helps.

stakx added a commit to stakx/moq that referenced this issue Mar 10, 2019
We want to continue publishing SourceLink-ed debug symbols, but using
classic Windows PDBs generates a huge package. Using the much smaller
portable PDB format would be much better, but some people may still
experience problems with those. (See e.g. GitHub issue devlooped#428.)

Let's follow the official guidance (see links below) and publish debug
symbols in a separate `.snupkg` package to NuGet's symbol server. This
means that we can (must, in fact) use portable PDBs as it will be the
consumers' choice whether to use the separate symbols or not.

References:
 * https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
 * https://github.com/dotnet/SourceLink#alternative-pdb-distribution
stakx added a commit to stakx/moq that referenced this issue May 27, 2019
We want to continue publishing SourceLink-ed debug symbols, but using
classic Windows PDBs generates a huge package. Using the much smaller
portable PDB format would be much better, but some people may still
experience problems with those. (See e.g. GitHub issue devlooped#428.)

Let's follow the official guidance (see links below) and publish debug
symbols in a separate `.snupkg` package to NuGet's symbol server. This
means that we can (must, in fact) use portable PDBs as it will be the
consumers' choice whether to use the separate symbols or not.

References:
 * https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
 * https://github.com/dotnet/SourceLink#alternative-pdb-distribution
ishimko pushed a commit to ishimko/moq4 that referenced this issue Sep 2, 2019
We want to continue publishing SourceLink-ed debug symbols, but using
classic Windows PDBs generates a huge package. Using the much smaller
portable PDB format would be much better, but some people may still
experience problems with those. (See e.g. GitHub issue devlooped#428.)

Let's follow the official guidance (see links below) and publish debug
symbols in a separate `.snupkg` package to NuGet's symbol server. This
means that we can (must, in fact) use portable PDBs as it will be the
consumers' choice whether to use the separate symbols or not.

References:
 * https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
 * https://github.com/dotnet/SourceLink#alternative-pdb-distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants