I know the answer to this question (which I'll post below the question). When I googled this error message nothing came up so I thought this might help someone else in the future. Here's the original problem:
I just switched build platforms (from TFS 2013 to TFS 2017) and now I can't Build - I get the error above. I started getting it for a different .dll so I deleted that .dll and now I get it for this one. It seems that no matter which .dll it encounters it gets this error.
So we use TFS do do the builds, but even if I just go to the command line with the same source and run iscmdbld I get the same error. Strangely if I do the same for the code pulled from a TFS2013 build it works fine. Also running signtool.exe works in the folder.
What could be causing this?
Seems simple enough, but when I googled "Fatal error -1027" nothing came up.
The problem was in the source mapping. I wasn't getting the cert to the correct place. And when I tried signing it from the command-line I was copying the cert into the build folder so that I didn't have to type out a long path.