I am trying to build simple console application for encryption and decryption in C# using libsodium. I have installed libsodium-net I am using visual studio 2019 and have installed Visual studio 2015-2019 redistributable. The build is succeeding but when i am trying to run its throwing an exception:
**System.TypeInitializationException**: 'The type initializer for 'Sodium.SodiumCore' threw an exception.'
Inner Exception
MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
Exception I have tried the solution listed here: Libsodium-net - Unable to load DLL 'libsodium.dll
But it didn't solve my problem. When I try to reinstall visual studio 2015 redistributable , it says setup failed because another version is already installed on the system.Installation error