title: Use Bouncy Castle library with .NET Compact Framework
body: <p>I’m trying to use <a href="http://www.bouncycastle.org/csharp/index.html" rel="nofollow">Bouncy Castle v1.7</a> on a Windows Mobile 6.5 device.</p>
  
  <p>I’m trying to execute the following code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>ISigner signer = SignerUtilities.GetSigner("SHA256withRSA");
  </code></pre>
  
  <h2>Using the Bouncy Castle binaries</h2>
  
  <p>On the Windows Mobile device, the code results in the following exception being thrown:</p>
  
  <blockquote>
    <p>"The version of the assembly System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=B77A5C561934E089 cannot be loaded by this version of the Microsoft .NET Compact Framework."</p>
  </blockquote>
  
  <p>On a classic desktop application (using the whole .NET framework), this code runs without problem.</p>
  
  <p>So I’m guessing there is an incompatibility between Bouncy Castle and the Compact Framework.
  However the <a href="http://www.bouncycastle.org/csharp/index.html" rel="nofollow">Bouncy Castle C# index page</a> says “<em>Source now builds on .NET Compact Framework 1.0</em>” for version 1.2</p>
  
  <h2>Compiling Bouncy Castle from source-code</h2>
  
  <p>I've also tried to compile Bouncy Castle from its source-code.<br>
  I've compile it using Visual Studio 2008 (had to convert the project and remove classes linked to the IDEA encryption algorithm that were referenced but missing) with the following compilation symbols: <strong>NET_1_1;NETCF_2_0</strong>  </p>
  
  <p>When I reference the DLL resulting from the compilation and run the code mentioned above (on a Device) I get the following exception:</p>
  
  <blockquote>
    <p>"Method not found: GetSigner Org.BouncyCastle.Security.SignerUtilities."</p>
  </blockquote>
  
  <p>This seems really strange since I get IntelliSense in Visual Studio while coding.</p>
  
  <p>Can someone tell me how to get Bouncy Castle running on Compact Framework 3.5 ?</p>
  
  <p>Thanks a lot,<br>
  Christophe</p>