I am trying to export the keys from a new instance of a ECDiffieHellmanCng object so I can create an instance of it later with the same keys. But I am getting an er
I believe you are specifying the wrong BLOB format. Try:
var privateKey = ecdh.Key.Export(CngKeyBlobFormat.Pkcs8PrivateBlob);
If that fails, you need to set up a key policy that allows private key export. See this answer: https://stackoverflow.com/a/10274270/2420979 for more details on your problem.