Project is building but not deploying, even after commenting everything out except Debug.Print("Program started."); EDIT - new problem

Hi,

I have quite a big project with lots of resources as well as using Glide, it builds fine but won’t deploy. I was testing the Glide stuff in a seperate project that worked fine, but now that I’ve integrated my Glide code into my main project it doesn’t deploy with the following error:

[quote]An error has occurred: please check your hardware.
Object reference not set to an instance of an object.
Source: Microsoft.SPOT.Debugger.CorDebug
Stack :
at Microsoft.SPOT.Debugger.VsProjectFlavorCfg.Deploy() in c:\depot\current\CLIENT_V4_2\Framework\CorDebug\VsProjectFlavorCfg.cs:line 893
at Microsoft.SPOT.Debugger.VsProjectFlavorCfg.<Microsoft.VisualStudio.Shell.Interop.IVsDeployableProjectCfg.StartDeploy>b__0() in c:\depot\current\CLIENT_V4_2\Framework\CorDebug\VsProjectFlavorCfg.cs:line 634
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
[/quote]

It looks like it is trying to use CLIENT_V4_2 to deploy but my application is 4.1 and my spider has v4.1 firmware on it.

Does anyone have any ideas why it isn’t deploying?

(EDIT: I tried reflashing the firmware but my spider won’t go into bootloader mode, it needs to be switch 1,2 and 3 ON and 4 doesn’t matter right?)

Thanks for your time,

Poncho

Check properties of the both projects make sure you are targeting 4.1. Also it help to recreate project/solution from scratch.

1 Like

Hi Architect,

Thanks for the reply, the projects are both targetting 4.1 that’s why I was confused but now I’ve copied everything into a new project and it deploys so there was something messed up with the settings of the original project.

Thanks for the help!

You are welcome! Looking forward to see your project on Showcase :wink:

Hah thanks, it should be done soon :slight_smile:

I’ve hit another problem now, my laptop has recently died and so I had to move everything over to my desktop, I was getting “wrong assembly” problems so I did a firmware update and made sure my pc side was up to date and copied all the files into a new solution to make sure I wouldn’t get those problems again with local references etc.

Well my problem now is that it thinks I’m not using the main thread. I get the error:

[quote]An unhandled exception of type ‘System.Exception’ occurred in Gadgeteer.dll

Additional information: Program must be instantiated on main (Dispatcher) thread.[/quote]

and here is the error in the output console:

Using mainboard GHIElectronics-FEZSpider version 1.0
    #### Exception System.Exception - 0x00000000 (1) ####
    #### Message: Program must be instantiated on main (Dispatcher) thread.
    #### Gadgeteer.Program::.ctor [IP: 0025] ####
    #### testProject.Program::.ctor [IP: 0011] ####
    #### testProject.Program::Main [IP: 000b] ####
A first chance exception of type 'System.Exception' occurred in Gadgeteer.dll
An unhandled exception of type 'System.Exception' occurred in Gadgeteer.dll

The thing is I am not using any other threads and haven’t touched the generated code for the project so don’t really know what’s happened.

Does anyone have any ideas about what to do?

Thanks,

Poncho

Oh I forgot to say that it breaks on the line:

Program program = new Program();

in Program.generated.cs.

This is different problem, not related to the original topic of this thread. Better start new thread next time.

Hmm. First time hear about it. Try to create simple project from scratch on your desktop, and see if the problem still exists.

Ah okay I will break it out into a new forum post next time, I guess it gets even more confusing when it comes to choosing a correct answer if I don’t.

Anyway, I’ve created a small sample project and that works great but my main project doesn’t do anything crazy, the only difference I can think of between the test one that works and the main one that produces that error is that the main one has timers in it to fire things off. Otherwise, both are using glide on the 4.3" display and a variety of input modules etc.

And I’ll just mention that the main project did work fine on my laptop before it died and I had to bring everything across to my desktop.

How exactly did you bring everything across?

I created a new solution on my desktop then copy/pasted the .cs files (and .gifs for glide) to the project folder then did “add existing item” to add all the files and then did a find and replace the original namespace in each .cs file with the new namespace of the new project.

If you can zip your whole solution folder I can take a look at what is exactly wrong with it.

Ah I’ve found what the problem was, I had recently changed one of my classes into a static class to be used as a singleton so that PressEvent/TapEvent/ReleaseEvent etc. of the Glide buttons could access it and this seemed to be making Gadgeteer angry.

But now I’ve hit the new problem of how to access that class inside these PressEvent… etc. events, otherwise I can’t really get my Glide buttons to do anything useful.

Thanks for all the troubleshooting Architect.

You are welcome!

Start a new thread about that new problem.

Yep I will do, thanks again :slight_smile: