Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NullRefernceException error when compilling (Read 2007 times)
Peter Baines
Junior Member
**
Offline


Posts: 18
Location: France
Joined: Sep 30th, 2011
NullRefernceException error when compilling
Jun 13th, 2016 at 6:17pm
Print Post  
HI Tim,

I have just installed the latest version of VM but get an odd error when i try to compile a project i was working on before i installed the update any ideas what this might be

It reads as follows ....

Compiling 'iTrap' for 'Arduino Uno'
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.SketchCode.countLines(String what)
   at Visual.Micro.MiroAppAPI.SketchCode.getLineCount()
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, PdePreprocessor preprocessor, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(String lbuildPath, Boolean verbose, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(Boolean verbose)
   at Visual.Micro.MiroAppAPI.SketchBuilder.build(Boolean verbose)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp._CompileDo(Project oProject, Boolean IsDebugStartCommand, Boolean isRebuild)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Project oProject, Boolean IsDebugStartCommand, Boolean isRebuild)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.Compile(Project oProject, Boolean IsDebugStartCommand, Boolean IsRebuild)


EDIT ... I also get the following when I load the solution

Build validation failed for sketch 'iTrap': Object reference not set to an instance of an object. Ide=Arduino 1.5

Second EDIT ... If i delete all the VS solution files leaving only the .ino arduino files and reopen as a new solution everything seems to be fine again.


« Last Edit: Jun 13th, 2016 at 6:23pm by Peter Baines »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: NullRefernceException error when compilling
Reply #1 - Jun 14th, 2016 at 10:56am
Print Post  
Hi,

I think you probably just needed to re-select the board. Looks like the project as previously using Arduino 1.5 and that you have changed to Arduino 1.6.x ?

I will retest what happens if you remove the 1.5 ide location so it becomes invalid.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint