Are you sure you are using the using
in the same project where the DLL has been added as a reference?
Edit 1: I just tried that and it is working for me. Please verify if you are using it in relevant project.
Question
I am trying to link to the BouncyCastle library in my ASP.NET MVC 5 application. I right clicked on my project, and went to the NuGet Packages. I installed BouncyCastle and I now see it in my references as BouncyCastle.Crypto. I want to use this package, so just like anything else I am trying:
using Org.BouncyCastle.Crypto
When I do this, I get an error that The type or namespace 'Org' could not be found
. If I try using BouncyCastle.Crypto
I get the same error, except this time for the type or namespace BouncyCastle
.
If I grep for BouncyCastle, I can see it in my packages:
packages/BouncyCastle.1.7.0/lib/Net40-Client/crypto.xml: <member name="T:Org.BouncyCastle.OpenSsl.PemReader">
One thing that I notice, however, is that it comes up as Net40-Client
. Is this an issue? Was it built using a client profile? If so, it seems similar to this issue. However, I am not sure how to actually change this profile if this is the case, since it is a pre-built library.
Solution
Are you sure you are using the using
in the same project where the DLL has been added as a reference?
Edit 1: I just tried that and it is working for me. Please verify if you are using it in relevant project.
OTHER TIPS
I was having the same issue. Eventually I noticed that BouncyCastle.Crypto.dll (which was in the correct project's bin folder) wanted me to right click on it and select "Include in Project". This was the fix I needed to succssfully reference the bouncy castle classes =^.^=
right click the project click unload then reload.
you should then see BouncyCastle in the references folder in the project.