0

I got a sample snippet code from OpenNETCF and cfAes, but name space definition is missing for some reason. Here is the missing namespace:

using OpenNETCF.Security.Cryptography.NativeMethods;

I tried to add reference for all the OpenNETCF libraries. But didn't work me.

Any thoughts?

Many thanks.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Kelvin
  • 1,103
  • 2
  • 11
  • 16
  • A using namespace directive can only be applied to namespaces; 'OpenNETCF.Security.Cryptography.NativeMethods' is a type not a namespace C:\xxxxxx\cfAes_source\cfAes\Rfc2898DeriveBytes.cs 2 7 cfAes – Kelvin Feb 05 '10 at 02:51
  • Use the vendor's forum: http://community.opennetcf.com/forums/53.aspx – Hans Passant Feb 05 '10 at 03:38

2 Answers2

2

Make sure you've got version compatability. A lot of the crypto stuff was in the early versions of the SDF because it was used for WSE and CF 1.0 didn't have much for crypto. As the CF matured and gained crypto and as WSE died and we pulled it out to its own library, we removed a lot of that stuff from the base SDF code base. If you have an old snipped and you're trying to compile against the newer binaries, the underlying calls you're after simply may not be there.

If that's the case, you're probably best served by getting the code for the older SDF (we've got them all available for download - bottom of the page) and pulling out the pieces that you need.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • I am using SDF 2.3.0.39 from my project. I need to implement AES using cfAes (as I want 512 keysize). Will I be able to include both old and new binaries in my project? – Let me Ask Mar 30 '11 at 09:11
  • 1
    Just pull the AES stuff you need directly into your app instead of trying to use two binaries with the same name. – ctacke Mar 30 '11 at 13:06
  • Excellent. I will try and let you know the results. – Let me Ask Mar 31 '11 at 07:41
0

That is an internal class in the main OpenNETCF.dll assembly. It's not a namespace. Try commenting it out to see if the class compiles.

codekaizen
  • 26,990
  • 7
  • 84
  • 140
  • Yep In addition, using OpenNETCF.Web.Services2.Security.Cryptography doesn't work as well. It says type or namespace 'Web' doesn't exist in name space OpenNETCF. – Kelvin Feb 05 '10 at 02:58