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 Another object reference error (Read 2983 times)
davidcoward
Junior Member
**
Offline


Posts: 48
Joined: Oct 5th, 2012
Another object reference error
Mar 19th, 2017 at 6:46pm
Print Post  
Hi there

I have a new Win10 laptop and have just installed VS2017 and the latest Visual Micro. When trying to build for Teensy 3.5, I get:

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(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)

This error did not arise on the previous installation. I have Arduino 1.8 and TeensyDuino 1.34.

« Last Edit: Mar 20th, 2017 at 12:32pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Another object reference error
Reply #1 - Mar 19th, 2017 at 6:58pm
Print Post  
Hi David,

Please zip and email your project folder to info[at]visualmicro.com

Thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Another object reference error
Reply #2 - Mar 19th, 2017 at 7:08pm
Print Post  
Hi David,

I have replicated the error and the problem is because some of your source is missing. 

You can use the button shown in the following image to see the view of the solution explorer that allows you to see the missing file. Note the yellow exclamation mark on the missing source file.

« Last Edit: Mar 19th, 2017 at 7:09pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
WWW  
IP Logged
 
davidcoward
Junior Member
**
Offline


Posts: 48
Joined: Oct 5th, 2012
Re: Another object reference error
Reply #3 - Mar 19th, 2017 at 10:30pm
Print Post  
Hi Tim

Yes, that was it! Somewhat oddly, the missing file shows up in a windows search, but not in the location it is supposed to be.

Thank you for responding on a Sunday night!

David
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Another object reference error
Reply #4 - Mar 20th, 2017 at 12:32pm
Print Post  
Great. There is a clearer message in the next release for people who encounter this issue after moving or deleting source code via windows explorer.
« Last Edit: Mar 20th, 2017 at 12:33pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint