Error “Showing a modal dialog box” with HASP enveloped .NET dll on a webserver

ASP .NET web application is referring to an enveloped dll. When that web application is deployed on IIS, it is throwing the following error:
"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.”

- Avoid using a DEMOMA (because it anyway pops out the message of “this is a demoma…”)
- Set envelope MESSAGE_OUTPUT_MODE to eventlog (“Windows” should not be used)
- Copy haspdnert.dll into c:\windows\system32
- Copy haspdnert.dll into some other path according to the Windows path