System.AccessViolationException at HASP login call on Windows 7

Problem: System.AccessViolationException was caught at hasp login() “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” Source=hasp_net_windows

Cause: hasp_net_windows.dll is not recognized and loaded properly

Solution: This is specific to Windows 7 settings. On few systems the issue is resolved after checking the UAC settings and turning the UAC OFF. Additionally, make sure to use the latest .NET sample available at: