News  [SoftwareSite

Latest News
Older News
RSS Feed
Complete Projects
Useful Classes
Top Downloads
Message Board
Send Comments
Software License Buttons
Forums -> Security Services for .NET 2.0 Forum
HMAC Error


by Chris [bluehampster at gmail dot com]
posted on 2008/01/16

The most recent release of the SecLib returns the error
"Error 3 'HMAC' is an ambiguous reference between 'System.Security.Cryptography.HMAC' and 'Org.Mentalis.Security.Cryptography.HMAC' seclib\Security\Ssl\Tls1\ExpansionDeriveBytes.cs 118 11 Security Library"

Is it just because I am using VS8? If so, do I need to install 7 or 7.1 to sort this?

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2008/01/30

It means that you have a the following two using statements in your code:

using System.Security.Cryptography;
using Org.Mentalis.Security.Cryptography;

And somewhere in you're code you instantiate a HMAC instance. This causes problems because the HMAC class is defined in both namespaces (and hence a nameclash occurs). Remove one of the two using statements, or use a full qualifier for the HMAC class.

by palani [palani dot vairavan at gmail dot com]
posted on 2009/06/20

It doesnt work even though we commented out any one of the namespaces

by Andrew [amellon at rcc dot com]
posted on 2009/12/02

You can use Org.Mentalis.Security.Cryptography.HMAC( ) whereever a new HMAC( ) or a variable of type HMAC is defined. This got rid of the ambiguity of using HMAC.


Copyright © 2002-2007, The Team. All rights reserved.
This site is located at
Send comments to the webmaster.