Unhanedled Exeptions! while trying to read a very simple analog input

In Gadgeteer programs, you don’t edit the program.generated.cs file, you only edit the program.cs file. By any chance did you edit the generated code? Can you show us the program.cs code - that is where ProgramStarted() is created for you when you first open the program.

As for PC#1 that you don’t care about, it may be an SDK installation issue. You should uninstall the GHI SDK pieces, and the netmf 4.2 QFE2, and reinstall the same pieces as you installed on your other PC.

Hi After I pasted Justin’s code from here:
http://www.tinyclr.com/forum/topic?id=8556&page=2#msg84904

I got this error in (program.generated.cs) although I didn’t modify it!:
Error 1 ‘GadgeteerApp1.Program’ does not contain a definition for ‘ProgramStarted’ and no extension method ‘ProgramStarted’ accepting a first argument of type ‘GadgeteerApp1.Program’ could be found (are you missing a using directive or an assembly reference?)
c:\users\MyUser\documents\visual studio 2010\Projects\GadgeteerApp1\GadgeteerApp1\Program.generated.cs 27 21 GadgeteerApp1

what do you think guys :S

@ PetaByte -
Try to use same application using MFwindowsApplication instead of console application
ans also remove “GPIO…” code from it

1 Like

when you’re using someone else’s code, create a new project that you expect to - in the case of Justin’s code, it’s a Gadgeteer project.

Then, copy over the code; copy the content of the programstarted() into the shell of the programstarted() that your project already has. Then copy any other code blocks into that.

As Andre has said, your code block that you pasted in does not match the class definition of the project shell you created. By just copying code over in small chunks and not taking whole files, you will avoid this. But if you understand what the reasons are, you can repair the file and avoid the problem.

1 Like

Guys, thank you very very much…

@ andre.marschalek Special thanks to you dude, the error was because of the name space as you suggested, and VS didn’t point the error to there at all

Thnks to all of you guys :))