2

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.

Community
  • 1
  • 1
gnychis
  • 7,289
  • 18
  • 75
  • 113

3 Answers3

1

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.

Abhinav
  • 2,085
  • 1
  • 18
  • 31
  • sigh, you're right. I forgot that I was editing a helper function in a different project that is still within the same solution. – gnychis Jan 16 '14 at 21:20
0

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 =^.^=

ccsandrew
  • 51
  • 11
0

right click the project click unload then reload.

you should then see BouncyCastle in the references folder in the project.