Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot find type [Org.BouncyCastle.Security.SecureRandom] #56
New-Object : Cannot find type [Org.BouncyCastle.Security.SecureRandom]: verify that the assembly containing this type
They continue on in the same vein from there. I went to that site and it apprears to be a helper class your using? I checked and couldn't find any dependencies listed in your documentation or code to load from there site. Any recommendations?
Thanks so much for doing this and any help you can provide!
This issue almost always revolves around the .NET Framework version installed on your system. The module requires .NET 4.7.1 or later which is also specified in the module manifest. But it looks like PowerShell doesn't enforce that for some reason. I really need to throw a manual check in there or something.
Here's a Microsoft page describing how to check what version of .NET you have installed by querying the registry. Here's an adapted one liner you can use to check:
(gp "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release
The value needs to be 461308 or greater to indicate that you have .NET 4.7.1 or later.
P.S. The primary reason you need .NET 4.7.1 is because the Bouncy Castle library I'm using is compiled against .NET Standard 2.0 which is technically to compatible with .NET 4.6.1. But my understanding is that .NET 4.6.1 apps have to be compiled with explicit support for it (which PowerShell is not) and only as of .NET 4.7.1 will all apps work with it. Suffice to say, it's kind of a confusing mess right now in the .NET world.