I managed to solve this issue by setting the ProtectionLevel of my project and its packages to EncryptSensitiveWithPassword. It was previously set to DoNotSaveSensitive.