Windows UWP build error with Couchbase.Lite in mspdbcmf.exe (error 1106)

When I build my Windows UWP app with Couchbase.Lite I get a build error. The Visual Studio build tools attempt to convert every PDB (incl. Couchbase.Lite.pdb) through mspdbcmf.exe. mspdbcmf.exe has no problem with any other PDB, but it crashes when processing Couchbase.Lite.pdb.

You can reproduce with VS 2019 or 2017 (I use 2019) with this commandline:
“C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\x86\mspdbcmf.exe” /check C:\Users\xxxxxx.nuget\packages\couchbase.lite.enterprise\2.5.0\lib\netstandard2.0\Couchbase.Lite.pdb

You’ll get this error:
C:\Users\xxxxxxxx.nuget\packages\couchbase.lite.enterprise\2.5.0\lib\netstandard2.0\Couchbase.Lite.pdb : fatal error CMF1106: failed to open input PDB file for reading (PDB error code = 13)3 input PDB file is not generated by /DEBUG:fastlinkW must read and agree to the Data Collection Policy at MSPDBCMF : fatal error CMF1000: internal error

Any ideas ?
It feels like it could be a bug in Microsoft’s mspdbcmf.exe tool. What do you think ?

I’ve seen that warning message for ages, but never that error. I can only imagine that “internal error” with no other context is a bug inside of their tool, but what is the “must read and agree” part?

As a workaround maybe you could delete the PDB file from the package and I could see if our build could make use of this “fastlink” thing. That wouldn’t be until at least the release after 2.6.0 though.

It looks like this is not a new bug though -> https://developercommunity.visualstudio.com/content/problem/307296/error-msb6006-mspdbcmfexe-exited-with-code-1106.html

I have played around with different PDBs and different options. I suspect the ‘must read and agree’ part is simply the artifact of some buffer overrun.
I’ll file a ticket with MSFT.

It looks like the workaround is to stop using portable PDB. Since CBL .NET is now using multi targeting this will be an easy change for just the UWP target unless the actual issue gets fixed before then.

I’ll update this thread when I have an answer from MSFT.