VS Arduino
>> >> Error opening/creating Arduino project (VS2015)
https://www.visualmicro.com/forums/YaBB.pl?num=1559403975

Message started by Xfer on Jun 1st, 2019 at 3:46pm

Title: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 1st, 2019 at 3:46pm
Hello everyone.
First post but long time licensed VisualMicro user. Great tool.

Just updated my VM extension (Visual Studio Community 2015 here) and now I can't open/create Arduino projects anymore. Worked fine before the last update.

Visual Studio 2015 in itself works fine (I can create/open Windows C++ projects just fine).

Reported error is:

[code]
Error during processing of the command. Please review or post the stack trace in the www.visualmicro.com forumObject reference not set to an instance of an object. (Visual.Micro.Visual.Studio.Arduino.Helper.SolutionOpenArduinoSketch)
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.SketchUtils.OpenSketchFilePicker(MCUApplication mcuApp)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.ExecCmd(String commandName)
[/code]

Visual Micro version:
1903.18.1

Operating system is:
Windows 10 Pro (64 bit)
Version 1809
Build 17763.529

Visual Studio is:
Visual Studio Community 2015
Version 14.0.2543101 Update 3

Things I tried:
Close/reopen Visual Studio
Restart the PC
Unistall/reinstall Visual Micro

Nothing worked.  :(

What could I try? Is there a previous version of VM available?

Thanks

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 1st, 2019 at 4:25pm
hi

Previous versions are in the releases section of this gallery.

questions

Is visual micro showing okay apart from that?

Does file>open>project work?

Does file>new>project work?

Are you using the community version of visual studio?

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 1st, 2019 at 4:28pm
1) Yes all VM-related menus are showing ok

I already stated what you asked:
2) Yes but only non-Arduino projects
3) Yes but only non-Arduino projects
4) Yes, VS Community 2015, so I downloaded the appropriate 2012-2015 version of VM extension

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 1st, 2019 at 4:39pm
Sorry but there is some confusion.

You only have to use File>Open Arduino Project" to open an Arduino project for the very first time. This allows Visual Micro to create the solution/project for you. After you have opened a sketch once you can open with File>Open or any other vs command to open the project or solution,

So it is possible to create a new project using File>New>Project>C++>Arduino Project
and
it is possible to open a project you have already worked on using File>Open>Project

These two options do not use the functions you have reported an error for.

Does file>open>project work?
Does file>new>project work?





Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 1st, 2019 at 5:13pm
File->Open->Project->Arduino Project does not work
File->New->Project->Arduino Project does not work

Used to work with the previous VM version.

All other project types work (C++ etc.)

I always opened existing Arduino projects (even if created with VM) via File->Open->Arduino Project.

Never tried (not even with previous VM versions) to open an Arduino project another way, so not sure what you are asking.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 1st, 2019 at 5:20pm
I'm happy to report that version:

1811.24.0

works well with VS 2015 Community.
I uninstalled the last version (1903.18.1), installed 1811.24.0, and now everything's back to normal: I can open and create Arduino Projects just fine.

Thanks for the support.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 1st, 2019 at 5:54pm
Thanks for the info.

A point to note that might save you some time. When you have opened an arduino .ino the first time then visual micro creates a c++ project file for you (vcxproj). This is a standard Visual Studio project which Visual Micro will open on future occasions using "file>open>arduino project".

When you subsequently use File>Open>Project or any of the standard VS open commands you will be able to navigate to where your arduino project is and open the project. Then visual studio will put the project on the "File>Recent>Project/Solutions" menu. It gives you one click access to your project, arduino projects are no different from a c++ project.

To create a new project don;t you use "file>new>project>c++>arduino project"?


ps: you should upgrade to vs2017 community. The visual micro version for 2012-2015 is now obsolete on a slow updates cycle if any. 2017 is better than 2015 anyway.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 1st, 2019 at 8:00pm
Can't update to VS2017 due to legacy (non-Arduino) projects I have to work with (distributed team all stick to VS2015 etc.).

To create a new project Arduino I use:
File->New->Arduino Project

which now works again, with the older 1811.24.0.
It's a bit disappointing the new 1903.18.1 does not work, but not a big issue after all.  ;)


Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 1st, 2019 at 8:14pm
Yes not idea why the open doesn't work. There haven't been other reports and it works okay for me in 2012-2015. It's a simple function that opens the standard windows file dialog. The only thing that has changed is the .net version we build for.

The open really isn't required unless you are opening an arduino .ino for the first time in which case file>open>file does the same thing.

We will try to add some more diagnostics for the next release

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 2nd, 2019 at 7:53am
To give more details, I temporarely reinstalled the problematic last version on VS2015

When I select "File->Open->Arduino Project" or "File->New->Arduino Project", an error popup occurs:

"Visual Micro
This feature requires an ide application to be selected"


and after that, the error I reported in the first post.

Hope this helps.
As I said, reverting to the 1811.24.0 brings everything working again.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 2nd, 2019 at 11:31am
Oh I see that is useful thanks. Which IDE and board do you have selected on the vMicro menu or toolbar?

What I am looking for is if you reinstall also required you to setup your arduino ide location again and if the setup dialog was failing to appear with the newer version. Now that you have run the older version did the setup dialog appear? Was it empty and you had to reapply the location of the arduino ide? Maybe waste of your time but if you now go back to the newer release do things work okay? and if not the n which ide is selected (arduino 1.6 etc)?

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 2nd, 2019 at 2:16pm
With the new version of vMicro, the IDE chooser box always remains as "Ide Setup".
If I select it, the IDE setup dialog appears, with the right IDE version and path; but still, accepting the dialog (OK), the IDE (Arduino 1.8.8 in my case) does not appear in the box!

Screenshots attached

vmicro_problem-1.png ( 22 KB | 3 Downloads )
vmicro_problem-2.png ( 58 KB | 2 Downloads )

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 2nd, 2019 at 2:24pm
With the old version (even if reinstalled after trying the new one), the correct IDE version appears in the box, without having to open the IDE setup dialog again.
Hope this helps.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 2nd, 2019 at 2:35pm
Ah thanks, yes the settings are not removed when you uninstall or upgrade. The issue in vs2015 with the new release is that it is failing to load the tool chains which is why it is in setup more and no IDE's are known.

I will look into some exception protection and reporting. It is most likely a json exception reading the package index files during load. The new/open won't work without an ide being available because those two functions use the sketch book folder to prompt the correct file location for the arduino ide. That's the difference between using the standard VS open and new v's the special "sketch" menus.


Thanks for the testing that is very useful.

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 2nd, 2019 at 2:52pm
+ if you can give me a list of the board package json files you have installed that would be useful. There is a list on the IDE locations dialog in Visual Micro and also maybe some you have added to File>Preferences in the Arduino IDE

Thanks

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Xfer on Jun 2nd, 2019 at 3:58pm
You mean the "boards.txt" files? Attaching them now...
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=boards_arduino.zip ( 4 KB | 3 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=boards_teensy.zip ( 5 KB | 0 Downloads )

Title: Re: Error opening/creating Arduino project (VS2015)
Post by Visual Micro on Jun 4th, 2019 at 12:23pm
Thanks, please also confirm what folder names you have, if any, below myDocuments\Arduino\Hardware

Also confirm the version of teensy and the arduino ide version

Thanks

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.