I'm curious if, on Windows 10, you need to have UAC elevation to write to those keys. In general, it is a bad behavior for a program to register itself for startup, because bad programs will automatically add themselves every time, even if a user doesn't want them there. The right tool for this is probably an installer.

You might try running your application with UAC elevation and see if it magically works. If that's the case, then there's not going to be an easy code-based solution for this.

For reference, I'm using VS 2015, but this particular bit of .NET hasn't changed much since at least .NET 2.0 and probably earlier.