signcode.exe error 80070057

Sometimes, when trying to sign a DLL which is already signed, you get the following error:

Error: Signing Failed.  Result = 80070057, (-2147024809)

Apparently it doesn’t like the fact that it is already signed.

The only solution I found to this problem is to recompile the DLL, and then signing it.