locked
is a type not a namespace... I'm just not seeing it!

    Question

  • I'm trying to compare files sizes of two files based on their hash marks. 

     

    I'm using the directive:

    using System.Security.Cryptography.HMACSHA1;

     

     

    However, I'm getting an error in compilation that reads:

    Error 1 A using namespace directive can only be applied to namespaces; 'System.Security.Cryptography.HMACSHA1' is a type not a namespace CFGutil C:\Projects\Other\CS\CFGutil\CFGutil\StartCompare.cs 3 7

     

    I'm stumpt!  Can anyone help me understand why I'm getting this error?

     

    Thanks in advance.

     

    JB

    Thursday, April 19, 2007 12:05 PM

Answers

  • Well, it's exactly what it's telling you. System.Security.Cryptography.HMACSHA1 is a type defined inside a namespace called System.Security.Cryptography.

    Just do using System.Security.Cryptography;
    Thursday, April 19, 2007 12:18 PM

All replies

  • System.Security.Cryptography.HMACSHA1 is class and System.Security.Cryptography is the namespace of it.

    So, make it using System.Security.Cryptography;

    That's it.

     

    Thanks,

    Ch.T.Gopi Kumar.

    Thursday, April 19, 2007 12:17 PM
  • Well, it's exactly what it's telling you. System.Security.Cryptography.HMACSHA1 is a type defined inside a namespace called System.Security.Cryptography.

    Just do using System.Security.Cryptography;
    Thursday, April 19, 2007 12:18 PM
  • Thanks for the reply. Oddly enough, I tried that before and 1 error turned in to 21 errors.  I'm just stumped. 

    Thursday, April 19, 2007 12:36 PM
  • Are they becuase of adding namespce so?

    Could you please post the errors?

     

    Thanks,

    Ch.T.Gopi Kumar.

    Thursday, April 19, 2007 12:47 PM
  • Thank you everyone.  I rewrote one of the modules and it works great now.

     

    J

    Thursday, April 19, 2007 3:13 PM
  • Another cause of this issue is when the class name and namespace is alike....i ran into same problem today. But when the namespace was altered the program started to work fine...


    Rakshith
    Monday, August 11, 2008 11:34 AM
  • Thanks for your reponse. It was very helpfull for me.

    Tuesday, April 12, 2011 4:11 PM