Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Error "Object reference not set" after update VM to latest version (Read 5664 times)
gj
Junior Member
**
Offline



Posts: 40
Error "Object reference not set" after update VM to latest version
Sep 4th, 2016 at 10:13pm
 
Hello,

I just updated VM to the latest version 1.1609.04 (I checked it in the VM options) within Visual Studio 2015 V14.0.25425.01 Update 3.
Arduino IDE is 1.6.11.
Right after that my project complained with the error above.

I set compiling to verbose, cleaned the build and then recompiled. Same error.

The last section of the details says:

Compiling debug version of 'BatteryCharger' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Build folder: file:///C:/Users/Gert-Jan/AppData/Local/Temp/VMicroBuilds/BatteryCharger/mega_at
mega2560
Additional Defines: VM_DEBUG;VM_DEBUG_ENABLE 1;VM_DEBUG_BANDWIDTH_THROTTLE_MS 50;VM_DEBUGGER_TYPE_HARDWARESERIAL 0;VM_DEBUGGER_TYPE_SOFTWARESERIAL 1;VM_DEBUGGER_TYPE_FASTSERIAL 2;VM_DEBUGGER_TYPE_USB 3;VM_DEBUGGER_TYPE_TEENSY 4;VM_DEBUGGER_TYPE_UART 5;VM_DEBUGGER_TYPE_USART 6;VM_DEBUGGER_TYPE_USBSERIAL 7;VM_DEBUGGER_TYPE_TTYUART 8;VM_DEBUGGER_TYPE_NET_CONSOLE 9;VM_DEBUGGER_TYPE_Uart 10;VM_DEBUGGER_TYPE_COSA 11;VM_DEBUGGER_TYPE_CDCSerialClass 12;VM_DEBUGGER_TYPE_HARDWARESERIAL1 13;VM_DEBUGGER_TYPE_HARDWARESERIAL2 14;VM_DEBUGGER_TYPE_HARDWARESERIAL3 15;VM_DEBUGGER_TYPE VM_DEBUGGER_TYPE_HARDWARESERIAL;VM_DEBUG_BREAKPAUSE;
Architecture Tools: {runtime.tools.avr-gcc.path}/bin/
Sketchbook: file:\\\H:\Development\Arduino
Sketch Include Paths
Core Include Paths
Include Path 'D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'D:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega'
"{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"D:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "C:\Users\Gert-Jan\AppData\Local\Temp\VMicroBuilds\BatteryCharger\mega_atmega256
0\BatteryCharger.cpp" -o "nul"
The system cannot find the file specified
     Preprocess: "{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"D:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "C:\Users\Gert-Jan\AppData\Local\Temp\VMicroBuilds\BatteryCharger\mega_atmega256
0\BatteryCharger.cpp" -o "nul"
   Object reference not set to an instance of an object


Right before the update there were no compiler errors.
The folders all seem correct and contain the files.
I also notice that ""vMicro->Compiler->Deep Search Includes" if OFF and I'm not able to switch it on.

Any thoughts?
Back to top
« Last Edit: Sep 5th, 2016 at 7:35pm by gj »  

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11074
United Kingdom
Re: Error "Oject reference not set" after update VM to latest version
Reply #1 - Sep 4th, 2016 at 10:34pm
 
Hi,

1) Does opening the visual micro explorer > board manager then clicking Rescan twice fix the issue?

2) For the "deep search". If you have more than one project in the solution then set the one you want to change to be the "Startup project". That will probably sort it out but I will look at why that is.

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
gj
Junior Member
**
Offline



Posts: 40
Re: Error "Oject reference not set" after update VM to latest version
Reply #2 - Sep 5th, 2016 at 7:06pm
 
Sorry, forgot to mention that, but I did rescanning (menu vMicro -> Board pulldown -> Find or install a board--> Rescan) several times after searching the forum. The output screen shows "Toolchain reload complete".
(I read the message "PLEASE NOTE: Upgrading Arduino IDE to 1.6.11 can cause compile errors. In that case open the "Visual Micro Explorer > Board Manager" then click the Rescan button twice. After that there should be no problems. Please report to the forum if you encounter other issues. Version 1609.4.3 + of Visual Micro is required for Arduino 1.6.11+")

The solution only has 1 project: The solution Explorer says: "Solution BatteryCharger (1 project)".  Undecided
Back to top
 
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11074
United Kingdom
Re: Error "Oject reference not set" after update VM to latest version
Reply #3 - Sep 5th, 2016 at 7:10pm
 
There is a fix published with the fix fie the menu item that worker but didn't show the tick. I doubt it will help.

Are you saying you did update Arduino ide as well as vm?

Did you try to click build,clean
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
gj
Junior Member
**
Offline



Posts: 40
Re: Error "Object reference not set" after update VM to latest version
Reply #4 - Sep 5th, 2016 at 7:42pm
 
First I updated vMicro to the latest version.
In the release notes I saw a reference to some issues with the latest Arduino IDE that were fixed in this release.
I was on Arduino IDE V1.6.9 and then updated to V1.6.11, which is the version I'm having installed now.

Then started VisStudio and then the mentioned error occurred.

And yes, I tried "Build -> Clean Solution" a few times and then selecting "Build -> Rebuild Solution". Same error.

Would something drastic like uninstall Arduino, uninstall VisStud and then reinstalling everything do the trick?
Back to top
« Last Edit: Sep 5th, 2016 at 7:43pm by gj »  
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11074
United Kingdom
Re: Error "Object reference not set" after update VM to latest version
Reply #5 - Sep 5th, 2016 at 8:21pm
 
okay i see you were using 1.6.9 originally so problem in both

please close all ides

delete the C:\Users\Gert-Jan\AppData\Local\Arduino15 folder

if you can zip and email the folder prior to delete that will help. the folder doesn't contain any user code. just board manager stuff and arduino preferences.txt

then start the arduino ide once. can close after.

then try visual micro



Back to top
« Last Edit: Sep 5th, 2016 at 8:22pm by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
gj
Junior Member
**
Offline



Posts: 40
Re: Error "Object reference not set" after update VM to latest version
Reply #6 - Sep 5th, 2016 at 10:07pm
 
I'm so sorry. You're helping me out so well and now I failed to ZIP the arduino15-folder for you.
(I was to eager in following your steps, so didn't read ahead...)
Even tried to use some recover-software but that only gave corrupted files...  Sad

But you DID give the correct solution: The error message is gone.
Thanks for your quick support.
Back to top
 
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11074
United Kingdom
Re: Error "Object reference not set" after update VM to latest version
Reply #7 - Sep 5th, 2016 at 10:22pm
 
No problem the main thing it is working.

I did think I should have put the zip request first because it's logical to perform each step.

But knowing it is resolved gives some clues as what to look for without zip.

If you had downgraded to an older arduino version it would have been more difficult to know what worked, hence the zip more important.

Thanks for the update.

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print