Test and Measurement Forum

Could not load type 'az' from assembly

Discussion forum for the new Picoscope Linux software

Could not load type 'az' from assembly

Postby cyril42e » Tue Jul 29, 2014 9:40 pm

Hi,

I insalled the latest version of picoscope with its dependencies (for 2204a) :
    libpicoipp-1.1.2-4r21.x86_64.rpm
    libusbtc08-1.8.8-1r03.x86_64.rpm
    libusbdrdaq-1.0.2-1r04.x86_64.rpm
    libps2000a-1.1.2-5r04.x86_64.rpm
    picoscope-6.10.1-4r8.noarch.rpm

I'm running Gentoo distribution, so I used the RPM packages that I manually installed by disabling the dependencies check, after resolving them manually (rpm -i --nodeps).

When trying to run the "picoscope" executable, I get the following error :
Code: Select all
Unhandled Exception: System.TypeLoadException: Could not load type 'az' from assembly 'PicoScope.GTK, Version=6.10.1.8, Culture=neutral, PublicKeyToken=d07fd3de7c3ccbb2'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'az' from assembly 'PicoScope.GTK, Version=6.10.1.8, Culture=neutral, PublicKeyToken=d07fd3de7c3ccbb2'.


Where is this 'az' type supposed to come from ? Is there a missing system dependency, or a version incompatibility ?

My system package versions :
    mono 2.10.9
    glibc 2.17
    gcc 4.7.3
    libusb 1.0.18

Thanks for your help !
cyril42e
Newbie
 
Posts: 0
Joined: Tue Jul 29, 2014 9:07 pm

Re: Could not load type 'az' from assembly

Postby mario_ » Wed Jul 30, 2014 8:12 am

Hi Cyril,

This kind of error usually tells that one or more dlls are not available to the assembly. Assuming that contents of /opt/picoscope/lib is on your system as it would be extracted from picoscope package (plus libp* files as drivers) and MONO_PATH is set /opt/picoscope/lib ( or you use picoscope script provided ), here is the list of DLLs that should your mono installation provide:

Code: Select all
/usr/lib/mono/4.0/mscorlib.dll
/usr/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
/usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
/usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
/usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
/usr/lib/mono/gac/gtk-dotnet/2.12.0.0__35e10195dab3c99f/gtk-dotnet.dll
/usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
/usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
/usr/lib/mono/gac/System.Management/4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
/usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
/usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
/usr/lib/mono/gac/UiaAtkBridge/1.0.0.0__f4ceacb585d99812/UiaAtkBridge.dll
/usr/lib/mono/gac/UIAutomationBridge/3.0.0.0__31bf3856ad364e35/UIAutomationBridge.dll
/usr/lib/mono/gac/UIAutomationClient/3.0.0.0__31bf3856ad364e35/UIAutomationClient.dll
/usr/lib/mono/gac/UIAutomationProvider/3.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
/usr/lib/mono/gac/UIAutomationSource/3.0.0.0__31bf3856ad364e35/UIAutomationSource.dll
/usr/lib/mono/gac/UIAutomationTypes/3.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
/usr/lib/mono/gac/UIAutomationWinforms/1.0.0.0__f4ceacb585d99812/UIAutomationWinforms.dll
/usr/lib/mono/gac/WindowsBase/4.0.0.0__31bf3856ad364e35/WindowsBase.dll


Please verify if they're present either in gac ( `gacutil -l | grep lib_name_without_dot_dll` ) or available at all in your mono compilation.

Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Could not load type 'az' from assembly

Postby mario_ » Wed Jul 30, 2014 8:17 am

Also, please note that correct driver for 2204a is libps2000.
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Could not load type 'az' from assembly

Postby cyril42e » Wed Jul 30, 2014 8:47 am

mario_ wrote:here is the list of DLLs that should your mono installation provide


Thank you for this information, I was indeed missing several DLLs. In addition to installing mono, I had to install the following Gentoo packages:
    atk-sharp
    gdk-sharp
    glib-sharp
    gtk-dotnet-sharp
    gtk-sharp

mario_ wrote:Also, please note that correct driver for 2204a is libps2000.


Thanks, good to know as it's not obvious (but I probably failed to read some doc).

So now it works, except that it crashes when the splash screen reads "Enumerating devices". The device is not plugged in, is it normal that it crashes if the picoscope is not plugged in? I cannot test with the device plugged in right now.
cyril42e
Newbie
 
Posts: 0
Joined: Tue Jul 29, 2014 9:07 pm

Re: Could not load type 'az' from assembly

Postby mario_ » Wed Jul 30, 2014 12:02 pm

If there is no device plugged it - it should call Demo device.

it is possible that it still crashes due to some other libraries loading in. Try running it without management script:
Code: Select all
cd /opt/picoscope/lib
mono PicoScope.GTK.exe


Should produce some helpful messages. Alternatively you could look for trace.xml files in folder inside ~/.local/share/Pico Technology/

Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Could not load type 'az' from assembly

Postby cyril42e » Wed Jul 30, 2014 1:58 pm

Actually I was still missing some DLLs you mentioned before, I also had to manually install (because not available in Gentoo's package manager):
    mono-uia-2.1-31.1.x86_64.rpm
    uiaatkbridge-2.0.2-10.1.2.x86_64.rpm
    uiautomationwinforms-2.0.2-10.1.1.x86_64.rpm

However I still get the same crash and the same error in the trace, related to a null reference:
Code: Select all
[...]
Device: Info: No of Devices Found: 0
InitalDeviceLoadSequence: Info: Complete
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Marshaling show signal
Exception: Error: Unhandled Exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at pL.a () [0x00000] in <filename unknown>:0
  at eH.a (jT , ProbeCategories ) [0x00000] in <filename unknown>:0
  at eH.a (jT , Boolean ) [0x00000] in <filename unknown>:0
  at dm.m (Boolean ) [0x00000] in <filename unknown>:0
  at ap.a () [0x00000] in <filename unknown>:0
  at az.a (System.Object , System.EventArgs ) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
Exception: Error: Inner Exception:System.NullReferenceException: Object reference not set to an instance of an object
  at pL.a () [0x00000] in <filename unknown>:0
  at eH.a (jT , ProbeCategories ) [0x00000] in <filename unknown>:0
  at eH.a (jT , Boolean ) [0x00000] in <filename unknown>:0
  at dm.m (Boolean ) [0x00000] in <filename unknown>:0
  at ap.a () [0x00000] in <filename unknown>:0
  at az.a (System.Object , System.EventArgs ) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0


Is the file pL.a part of picoscope suite? Is there a way to get debug info?

Thanks
cyril42e
Newbie
 
Posts: 0
Joined: Tue Jul 29, 2014 9:07 pm

Re: Could not load type 'az' from assembly

Postby cyril42e » Thu Jul 31, 2014 7:41 am

Hi,

I tried with the picoscope plugged in, the software sees it but the device makes a noise "click-click", the LED blinks a few times then goes off, and the software crashes with the same trace. From the log it seems that it successes to open the device, but then tries again and fails (maybe when the LED goes off?), even if in the end it says it found and selected a device.

Code: Select all
[...]
    <event time="31/07/14 00:44:09.874" category="Device" level="Info">Finished loading ps2000a.dll</event>
    <event time="31/07/14 00:44:09.875" category="Device" level="Info">Attempting to load ps2000.dll</event>
    <event time="31/07/14 00:44:10.214" category="Device" level="Info">Finished loading ps2000.dll</event>
    <event time="31/07/14 00:44:10.214" category="Device" level="Info">Opening device using DLL ps2000.dll</event>
    <event time="31/07/14 00:44:14.686" category="Device" level="Info">Opening device successful. Error NoError.</event>
    <event time="31/07/14 00:44:14.687" category="Device" level="Info">Device opened CZ413/199: PS2000 PS2204A PS2000</event>
    <event time="31/07/14 00:44:14.688" category="Device" level="Info">Attempting to load ps2000.dll</event>
    <event time="31/07/14 00:44:15.032" category="Device" level="Info">Finished loading ps2000.dll</event>
    <event time="31/07/14 00:44:15.032" category="Device" level="Info">Opening device using DLL ps2000.dll</event>
    <event time="31/07/14 00:44:15.035" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
    <event time="31/07/14 00:44:15.036" category="Device" level="Info">Attempting to load usbdrdaq.dll</event>
    <event time="31/07/14 00:44:15.037" category="Device" level="Info">usbdrdaq.dll System.DllNotFoundException: usbdrdaq.dll
  at (wrapper managed-to-native) cx/a:a (int16,int16)
  at cx.LoadDll () [0x00000] in &lt;filename unknown&gt;:0
  at u.DoIsDllAvaialable () [0x00000] in &lt;filename unknown&gt;:0 </event>
    <event time="31/07/14 00:44:15.037" category="Device" level="Info">Finished loading usbdrdaq.dll</event>
    <event time="31/07/14 00:44:15.037" category="Device" level="Info">Attempting to load pl1000.dll</event>
    <event time="31/07/14 00:44:15.038" category="Device" level="Info">pl1000.dll System.DllNotFoundException: pl1000.dll
  at (wrapper managed-to-native) cw/a:a (int16,int16)
  at cw.LoadDll () [0x00000] in &lt;filename unknown&gt;:0
  at u.DoIsDllAvaialable () [0x00000] in &lt;filename unknown&gt;:0 </event>
    <event time="31/07/14 00:44:15.038" category="Device" level="Info">Finished loading pl1000.dll</event>
    <event time="31/07/14 00:44:15.038" category="Device" level="Info">No of Devices Found: 1</event>
    <event time="31/07/14 00:44:15.038" category="Device" level="Info">Device selected: PS2204A, CZ413/199</event>
    <event time="31/07/14 00:44:15.039" level="Info">Driver: ps2000.dll Version: PS2000 Linux Driver, 2.1.2.4</event>
    <event time="31/07/14 00:44:15.039" level="Info">Kernel driver: picopp.sys Version: 0.0</event>
    <event time="31/07/14 00:44:15.039" category="InitalDeviceLoadSequence" level="Info">Complete</event>
    <event time="31/07/14 00:44:15.695" category="Exception" level="Error">Unhandled Exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object
  at pL.a () [0x00000] in &lt;filename unknown&gt;:0
  at eH.a (jT , ProbeCategories ) [0x00000] in &lt;filename unknown&gt;:0
  at eH.a (jT , Boolean ) [0x00000] in &lt;filename unknown&gt;:0
  at dm.m (Boolean ) [0x00000] in &lt;filename unknown&gt;:0
  at ap.a () [0x00000] in &lt;filename unknown&gt;:0
  at az.a (System.Object , System.EventArgs ) [0x00000] in &lt;filename unknown&gt;:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&amp;)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in &lt;filename unknown&gt;:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in &lt;filename unknown&gt;:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in &lt;filename unknown&gt;:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in &lt;filename unknown&gt;:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in &lt;filename unknown&gt;:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in &lt;filename unknown&gt;:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in &lt;filename unknown&gt;:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in &lt;filename unknown&gt;:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in &lt;filename unknown&gt;:0 </event>
    <event time="31/07/14 00:44:15.696" category="Exception" level="Error">Inner Exception:System.NullReferenceException: Object reference not set to an instance of an object
  at pL.a () [0x00000] in &lt;filename unknown&gt;:0
  at eH.a (jT , ProbeCategories ) [0x00000] in &lt;filename unknown&gt;:0
  at eH.a (jT , Boolean ) [0x00000] in &lt;filename unknown&gt;:0
  at dm.m (Boolean ) [0x00000] in &lt;filename unknown&gt;:0
  at ap.a () [0x00000] in &lt;filename unknown&gt;:0
  at az.a (System.Object , System.EventArgs ) [0x00000] in &lt;filename unknown&gt;:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&amp;)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in &lt;filename unknown&gt;:0 </event>
    <event time="31/07/14 00:44:15.708">Trace Closing</event>
</document>
cyril42e
Newbie
 
Posts: 0
Joined: Tue Jul 29, 2014 9:07 pm

Re: Could not load type 'az' from assembly

Postby mario_ » Thu Jul 31, 2014 9:25 am

Hi,

You could try running mono with a trace enabled: mono --trace PicoScope.GTK.exe
It will produce a lot more information and frankly I'm not sure how readable would it be for you.

Decoding the stacktrace kind of tells us that PicoScope is having problems in recognizing localization/regional information. In the past it was due to System.Runtime.Serialization.dll missing. Can you double check if it is present on your system?

Here is the list of dependencies on Debian:
Code: Select all
mono-runtime (>= 2.10.8.1), libmono-system-core4.0-cil (>= 2.10.8.1), libmono-system-management4.0-cil (>= 2.10.8.1), libmono-system-windows-forms4.0-cil (>= 2.10.8.1), libmono-system-runtime-serialization4.0-cil (>= 2.10.8.1), libmono-windowsbase4.0-cil (>= 2.10.8.1), libgtk2.0-cil (>= 2.12.10)

Sometimes it is worth to install mono-complete package to fill any gaps.
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Could not load type 'az' from assembly

Postby greg » Fri Aug 01, 2014 12:29 pm

a possible workaround is to either edit or create the preferences.xml file in ~/.local/share/Pico Technology/260a68f1-30f-0a5e01d65514/ with the following entries:

Code: Select all
<preferences version="2.0.0">
  <category name="culture">
    <preference name="Language" value="en-US" />
    <preference name="measurementsystem" value="Metric" />
  </category>
</preferences>
greg
PICO STAFF
PICO STAFF
 
Posts: 23
Joined: Mon Dec 16, 2013 9:09 am

Re: Could not load type 'az' from assembly

Postby cyril42e » Mon Aug 04, 2014 8:29 am

Hi,

You're right it was a localization problem!

I do have System.Runtime.Serialization.dll on my system, and I tried to install all the -sharp and -dotnet packages available but it didn't change anything.

However the edit of the preferences file suggested by greg solved the problem (haven't tried with the picoscope plugged in though).

Thanks for your help!
cyril42e
Newbie
 
Posts: 0
Joined: Tue Jul 29, 2014 9:07 pm

Re: Could not load type 'az' from assembly

Postby kristianf » Mon Sep 08, 2014 12:05 pm

cyril42e wrote:I'm running Gentoo distribution, so I used the RPM packages that I manually installed by disabling the dependencies check, after resolving them manually (rpm -i --nodeps).


Hi cyril (or anyone else running Gentoo hitting upon this post as I did): Please note that I've now made Gentoo ebuilds for Picoscope available in my portage overlay at layman[mercurial]:k_f ( https://bitbucket.org/kristianf/portage-overlay/src ). Once the packages are stabilized enough I might consider bringing them into the regular portage tree as well. If you (or anyone else) use these packages and encounter issues, please report them in the bitbucket bugtracker. Testing is much appreciated.

NB! This is only a preliminary upload and currently I've only enabled x86_64 versions. Additionally I need to inspect and specify license terms and dependencies more detailed.

Kristian Fiskerstrand
Gentoo Developer
kristianf
Newbie
 
Posts: 0
Joined: Mon Sep 08, 2014 11:57 am


Return to PicoScope for Linux

Who is online

Users browsing this forum: No registered users and 0 guests