Main Site Documentation

Strange workaround for System.Diagnostics.DebuggerBrowsableState


#1

I compiled this library using the latest Netmf (something with R2 in it) and had a strange error, that made the device go into “Waiting for debugger” or something.

Within Visual Studio it said (in the output window) that it is unable to find the DebuggerBrowsableState enumeration.

I fixed that behavior by simply adding a enumeration with the same name and values (and namespace) to my project.

Now it works. But I really don’t like the workaround. Is that a Netmf problem? And btw. this library is awesome :slight_smile:


#2

Did you get the error at compile time or during deploy?
Could you post your VS output window content.


#3

Hi Reinhard,

during the deployment only. Here you go:
[b]
Found debugger!

Create TS.

Loading start at a0e00000, end a0e2f494

Assembly: mscorlib (4.3.1.0) Assembly: Microsoft.SPOT.Native (4.3.1.0) Assembly: Microsoft.SPOT.Security.PKCS11 (4.3
.1.0) Assembly: System.Security (4.3.1.0) Assembly: Microsoft.SPOT.Hardware (4.3.1.0)
Assembly: Microsoft.SPOT.Graphics (4.3.1.0) Assembly: Microsoft.SPOT.TinyCore (4.3.1.0)
Assembly: Microsoft.SPOT.IO (4.3.1.0) Assembly: System.IO (4.3.1.0) Assembly: Microsoft.SPOT.Hardware.Usb (4.3.1.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.3.1.0) Assembly: Microsoft.SPOT.Touch (4.3.1.0)
Assembly: Microsoft.SPOT.Ink (4.3.1.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.3.1.0)
Loading Deployment Assemblies.

Attaching deployed file.

Assembly: Gadgeteer.WebServer (2.43.1.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net.Security (4.3.1.0) Attaching deployed file.

Assembly: Gadgeteer.DaisyLink (2.43.1.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.Extender (4.3.6.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.EthernetJ11D (4.3.6.0) Attaching deployed file.

Assembly: GHI.Hardware (4.3.6.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net (4.3.1.0) Attaching deployed file.

Assembly: Gadgeteer.SPI (2.43.1.0) Attaching deployed file.

Assembly: System.Net.Security (4.3.1.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.SDCard (4.3.6.0) Attaching deployed file.

Assembly: GHIElectronics.Gadgeteer.FEZSpider (4.3.6.0) Attaching deployed file.

Assembly: GHI.Networking (4.3.6.0) Attaching deployed file.

Assembly: Gadgeteer.WebClient (2.43.1.0) Attaching deployed file.

Assembly: System (4.3.1.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.Button (4.3.6.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.MulticolorLED (4.3.6.0) Attaching deployed file.

Assembly: Kaushik.Spot.Library.MF (1.0.0.0) Attaching deployed file.

Assembly: GHI.Usb (4.3.6.0) Attaching deployed file.

Assembly: System.Http (4.3.1.0) Attaching deployed file.

Assembly: GadgeteerApp6 (1.0.0.0) Attaching deployed file.

Assembly: GTM.GHIElectronics.DisplayTE35 (4.3.6.0) Attaching deployed file.

Assembly: Gadgeteer (2.43.1.0) Resolving.

Resolve: unknown type: System.Diagnostics.DebuggerBrowsableState

Error: ff000000

Waiting for debug commands…

The program ‘[29] Micro Framework application: Managed’ has exited with code 0 (0x0).

[/b]
It does not happen when I add a new source file and re-define this enum:


using System;
using Microsoft.SPOT;

namespace System.Diagnostics
{
    public enum DebuggerBrowsableState
    {
        Collapsed,
        Never,
        RootHidden
    }
}

#4

No, not in that library. Just checked. If you download the solution it is the Kaushik.Spot.Library.MF project.


#5

Sounds like a missing assembly, that is linked in a way, so the compiler can not find the problem!?

You should check which assembly from the framework contains this enum, and add it as a reference to your project.


#6

It’s mscorlib and that has to be in every project. This is why it is so strange.


#7

What device type and exact firmware do you use.
May be there is a ‘bug’ in the firmware. Means that type is missing in it.


#8

That’s a great idea :slight_smile: Is there any way I can squeeze out more debugging information’s ? Visual Studio settings don’t allow me more than that what you have seen in the output window. I am still new to the platform, but not to .NET. Maybe some serial or usb debugging tricks?


#9

@ Reinhard - That’s a good idea as well. Here is the firmware information:

[b]
Loader (TinyBooter) version information:
4.3.4.0 on this computer.
4.3.4.0 on this device.

The Loader (TinyBooter) is up to date. <<<

Firmware (TinyCLR) version information:
4.3.6.0 on this computer.
4.3.6.0 on this device.

The Firmware (TinyCLR) is up to date. <<<
Please wait for the device to reboot… Done.
[/b]

and a Fez Spider Version 1 board.

But where can I find that information?


#10

@ andre Ok. What about the build tasks? Could there be something wrong?


#11

I will test that right away. And post the result.


#12

@ AWSOMEDEVSIGNER - Spider I, that’s an EMX then, I didn’t use one for a while.
I use G120 with the same firmware without any issues like this.


#13

Ok. No error this time. But how can I find out which assembly it is? Sequentially adding the assemblies?

Here is the output:

[b]
Found debugger!

Create TS.

Loading start at a0e00000, end a0e2f494

Assembly: mscorlib (4.3.1.0) Assembly: Microsoft.SPOT.Native (4.3.1.0) Assembly: Microsoft.SPOT.Security.PKCS11 (4.3
.1.0) Assembly: System.Security (4.3.1.0) Assembly: Microsoft.SPOT.Hardware (4.3.1.0)
Assembly: Microsoft.SPOT.Graphics (4.3.1.0) Assembly: Microsoft.SPOT.TinyCore (4.3.1.0)
Assembly: Microsoft.SPOT.IO (4.3.1.0) Assembly: System.IO (4.3.1.0) Assembly: Microsoft.SPOT.Hardware.Usb (4.3.1.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.3.1.0) Assembly: Microsoft.SPOT.Touch (4.3.1.0)
Assembly: Microsoft.SPOT.Ink (4.3.1.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.3.1.0)
Loading Deployment Assemblies.

Attaching deployed file.

Assembly: Gadgeteer (2.43.1.0) Attaching deployed file.

Assembly: GHI.Hardware (4.3.6.0) Attaching deployed file.

Assembly: GadgeteerApp7 (1.0.0.0) Attaching deployed file.

Assembly: Kaushik.Spot.Library.MF (1.0.0.0) Attaching deployed file.

Assembly: System (4.3.1.0) Attaching deployed file.

Assembly: GHI.Usb (4.3.6.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net (4.3.1.0) Attaching deployed file.

Assembly: GHIElectronics.Gadgeteer.FEZSpider (4.3.6.0) Resolving.

GC: 1msec 36828 bytes used, 7302840 bytes available

Type 0F (STRING ): 24 bytes

Type 15 (FREEBLOCK ): 7302840 bytes

Type 17 (ASSEMBLY ): 34968 bytes

Type 1E (BINARY_BLOB_HEAD ): 1332 bytes

Type 28 (MEMORY_STREAM_HEAD ): 36 bytes

Type 29 (MEMORY_STREAM_DATA ): 396 bytes

Type 34 (APPDOMAIN_HEAD ): 72 bytes

GC: performing heap compaction…

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Security.PKCS11.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.Security.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Graphics.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.TinyCore.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.SerialPort.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Touch.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Ink.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Net.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.3\le\Gadgeteer.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.3 SDK\Libraries\le\GHI.Hardware.dll’
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.3 SDK\Libraries\le\GHI.Usb.dll’
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Mainboards\FEZSpider\NETMF 4.3\le\GHIElectronics.Gadgeteer.FEZSpider.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘c:\users\ilija\documents\visual studio 2013\Projects\GadgeteerApp7\GadgeteerApp7\bin\Debug\le\GadgeteerApp7.exe’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘D:\gitsource\kaushikspotservices\Kaushik.Spot\Kaushik.Spot.Library.MF\bin\Debug\le\Kaushik.Spot.Library.MF.dll’, Symbols loaded.
The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZ Spider version 1.0
Program Started

[/b]


#14

@ Andre, @ Reinhard Thanks for all the help :slight_smile: I think I messed something up by myself. If you need help on Azure, Store Apps, WCF and similar, please let me know.