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 Visual Studio Solutions with multiple Arduino Projects (Read 2986 times)
Francesco14
Newbies
*
Offline


Posts: 8
Joined: Mar 25th, 2014
Visual Studio Solutions with multiple Arduino Projects
Dec 26th, 2017 at 9:44pm
Print Post  
Hi all,
I use Visual Micro from some years now; currently I'm using it with Visual Studio 2017 Community Edition.
Recently I started working on some projects with Moteino (www.lowpowerlab.com) that require a sketch for the gateway and as many sketches as the different kind of remote "nodes" one decide to use.
Visual Studio Solutions are very helpful with this kind of applications because they permit to have access to the complete code of an hardware project.
However I observed a behaviour that I think should be modified/corrected, at least if possible: if I open a sketch of the solution not marked as the "startup project", all commands (Compile, Rebuild, Clean, etc.) work on the open project but the Run/Debug command always causes the upload of the startup project on the currently selected Moteino/Arduino COM port!
In my specific case, for example, if I open a sketch corresponding to a node of the network but the startup project corresponds to another node or to the gateway, when I hit the run button on the toolbar, the sketch that is recompiled and uploaded to the currently selected COM port is the one corresponding to the startup project.
The only way to obtain the upload of the correct sketch on the correct Moteino/Arduino seems to be marking it as the startup project prior to hit the Run/Debug command.
Certainly this is a behaviour inherited from Visual Studio, but I'm guessing if it is modifiable/customizable in Visual Micro.
Any hint will be appreciated.
« Last Edit: Dec 27th, 2017 at 8:48am by Francesco14 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio Solutions with multiple Arduino Projects
Reply #1 - Dec 28th, 2017 at 10:50pm
Print Post  
Hi

There are some options but you are right we have to consider how vs works. If you look at the Debug menu it says "Start project x". We can't change that menu and it also applies to "Build project x".

Normally VS is tied to the Startup project unless you right click the project in the solution explorer and click "Start new instance". Then Visual Micro will build/upload the project. 

However, debugging should always be for the startup project otherwise things get confusing.

Visual Micro does attempt to allow a slight variation based on the currently active code/project.  However this can be confused if you have switched off the setting that synchronises the solution explorer with currently active code editor

The port selection is stored for the currently active code or project. Same for the board selection. If you do not have this behaviour we must look at what "currently active code/project" means in context of what I have said.

Does this help at all?
  
Back to top
WWW  
IP Logged
 
Francesco14
Newbies
*
Offline


Posts: 8
Joined: Mar 25th, 2014
Re: Visual Studio Solutions with multiple Arduino Projects
Reply #2 - Jan 2nd, 2018 at 10:03am
Print Post  
Hi Tim,

thank you for taking the time to answer my question.

I feared that the modification of the behaviour of Run/Build menù or toolbar buttons of VS was not easy or possible at all...

The "start new instance" workaround seems to work well, but what about the possibility to modify at least the behaviour of "Build" and "Build and Upload" additional buttons of VM? In my opinion it should be possible; however consider this only as a hint!

Thank you again for your willingness.

Best regards

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio Solutions with multiple Arduino Projects
Reply #3 - Jan 2nd, 2018 at 12:53pm
Print Post  
The vm build and build/upload should always upload the active code project unless you have disabled the feature in tools>options. In which case the vm  buttons will always build the startup project.

Please be clear about your report concerning the vm buttons and be clear about what is selected when you click the buttons and be clear about if you have detached the solution explorer from showing the currently active code file.

A screen shot might help

Thanks
« Last Edit: Jan 2nd, 2018 at 12:53pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Francesco14
Newbies
*
Offline


Posts: 8
Joined: Mar 25th, 2014
Re: Visual Studio Solutions with multiple Arduino Projects
Reply #4 - Jan 2nd, 2018 at 4:37pm
Print Post  
Hi Tim,

thank you for your answer; I just verified that the problem was caused by that option set to false.

I was simply unaware of its presence between VM options; sorry for the inconvenience.

Regards

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio Solutions with multiple Arduino Projects
Reply #5 - Jan 2nd, 2018 at 7:33pm
Print Post  
Thanks for for the update. It should be on by default. I will look into it.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint