Exception in Accord.Math.Random.Generator

29 views
Skip to first unread message

lov...@yahoo.com

unread,
Jun 2, 2016, 6:14:53 PM6/2/16
to Accord.NET Framework
Hi there,

I have Accord Framework version 3.0, Windows 7, VS2010 (vb.net)

While using the IndependentComponentAnalysis.Compute function
I get the following error:

"The type initializer for 'Accord.Math.Random.Generator' threw an exception."

Inner Exception : {"Method not found: 'Void System.Threading.ThreadLocal`1..ctor(System.Func`1<!0>, Boolean)'."}


I am attempting to use the example code at:
http://accord-framework.net/docs/html/T_Accord_Statistics_Analysis_IndependentComponentAnalysis.htm

Any help would be much appreciated,
Paul

César

unread,
Jun 4, 2016, 3:13:19 PM6/4/16
to Accord.NET Framework
Which version of the framework are you using? If you are using 3.5, please make sure that you are using the framework assemblies that were made for .NET 3.5. If you are using NuGet, this should happen automatically. If you are referencing the libraries yourself, please make sure you select the .dlls in the net35 folder.

If, however, you still get this message even though you believe you are using the correct versions of those libraries, please try re-building your solution after cleaning all your projects. It might be the case that an older version of the framework is being picked up by Visual Studio.

Best regards,
Cesar

woodpeckerpaul

unread,
Jun 4, 2016, 3:32:36 PM6/4/16
to Accord.NET Framework
Hi Cesar,

Thanks for your reply. I was using version 3.0 downloaded directly, but I am now going to try the Nuget route as you advised.
I will get back in the next couple of days with my findings.

Regards,
Paul

woodpeckerpaul

unread,
Jun 5, 2016, 4:37:39 AM6/5/16
to Accord.NET Framework
Hi Cesar,

Yes, it seems that NuGet will not work with VS2010 (only VS2013 and VS2015), so I couldn't use it.

But I reinstalled the Accord Framework using the Accord installer download.

My problem was solved by setting the Advanced Compile Options in VS2010 to .net Framework 3.5 (not  .net Framework 3.5 Client Profile).

Thanks again for your help, I have now converted several of the sample programs to vb.net and they are running ok.


Reply all
Reply to author
Forward
0 new messages