1

I have been using HASP 5.0 in my .Net 4.0 (VS2010, Win 7) application with no problems.

I am adding some new functionality and am trying to create unit tests for it. I am not able to run code from the test project that logs into the hasp license. After logging in with vendor code, I get HaspStatus.HaspDotNetDllBroken {652}. The same code does run OK from the main project.

I copied the following files:

apidsp_windows.dll
apidsp_windows_x64.dll
hasp_net_windows_x64.dll
hasp_windows_NNNNN.dll (my client DLL)
hasp_windows_x64_114204.dll

into the test execution directory, and added a reference to hasp_net_windows.dll into the test project.

I also tried to have the problematic code in the test function (not the main code base) but have the same problem.

Any ideas

Magnus Lindhe
  • 7,157
  • 5
  • 48
  • 60
GilShalit
  • 6,175
  • 9
  • 47
  • 68
  • Does it compile in the Test projects? Can you provide a error stack? Does the Test and Main project run the same .NET profile? And referencing the same .NET assemblies? – Jocke Apr 11 '13 at 07:11
  • It does compile in the Test project. The two run in the Debug Profile. The question about the references is interesting - I will play around a bit. – GilShalit Apr 11 '13 at 07:15
  • With profile I don't mean Debug or Release. I mean ASP.NET profile or Client profile and so on. One more thing: are they running the same .NET target framework (and version)? – Jocke Apr 11 '13 at 07:27
  • Strangely I can not see the framework drop down list in the application tab of the properties screen, so I can not make sure. And how do I find the profile? – GilShalit Apr 11 '13 at 08:10
  • Depends on how you VS is set-up, they should be available under Target framework. Here is a msdn page (http://msdn.microsoft.com/en-us/hh487283.aspx) on the topic. But it might not be related to your problem... Can you post you exception and stack trace as well? – Jocke Apr 11 '13 at 08:55
  • There is no exception. The HASP object returns a status that is not OK. – GilShalit Apr 11 '13 at 12:06
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28025/discussion-between-gilshalit-and-jocke) – GilShalit Apr 11 '13 at 12:07

0 Answers0