VS Arduino
Visual Micro >> Project Guidance >> Using visual micro with Visual studio and github
https://www.visualmicro.com/forums/YaBB.pl?num=1571158588

Message started by Ade on Oct 15th, 2019 at 4:56pm

Title: Using visual micro with Visual studio and github
Post by Ade on Oct 15th, 2019 at 4:56pm
Sorry for a complete noob question, but what is the best process for using github for version control/storage and sharing of the code between two computers (my desktop and my laptop).  It seems that either you can't or just that I don't know how to force all libs/board packages into the project directory. I can get the project to compile on one machine, but it fails with dependency errors on the second (laptop).


Thanks


Title: Re: Using visual micro with Visual studio and github
Post by Visual Micro on Oct 19th, 2019 at 2:51pm
Hi,

You have two options.

#1
The 1st is the way you are working which means to ensure you have installed the same Arduino libraries on both machines.

or complete source control ...

#2

If you look at the "Add Library" menu in Visual Micro you will see an option that says "Clone to Solution". Using that option then selecting any libraries you want to use will automatically create a local COPY of a library alongside the solution. The option will also add a new project into the solution and add  reference from the arduino project to the library.

When working with source control it is important to keep the solution and project(s) folder structured proerly. The ideal is as follows:-

Solution Folder (.sln)
     MainProject1 (.vcxproj)
     Libraries
          Library1 (.vcxitems)
          Library2 (.vcxitems)

Next to each folder example above I have shown the names of the file extensions. These are the Visual Studio files that keep track of what is included at each level and where the files are located. These files are just text files that you can edit, if you ever want to move things around to re-structure that can be useful. The files should contain relative paths which means the same structure will work on a diffrent machine or from a different location. The relative paths are one main reason for keeping a neat/simple folder structure.

If you opened an existing Arduino project the solution (.sln) might be in the same folder as the arduino project (.vcxproj) and the .ino./source code. If so it is a good idea to drop the project down one level leaving the .sln in a parent folder. If you create a new project using "File>New>Project>C++>Arduino Project" then Visual Studio will automatically create the .sln in a higher folder to the project (.vcxproj).

Finally, I guess you don't mind installing the Arduino IDE on both machines? If not then use the NoIDE option in Visual Micro but then you might need to use the Visual Micro Library Manager to install libraries such as EEPROM and SPI that are often used from the installed ArduinoIDE\libraries folder.

You should find it quite easy to ensure the correct structure and I reccomend doing it as soon as possible.

Let us know how it goes.






Title: Re: Using visual micro with Visual studio and github
Post by Ade on Oct 26th, 2019 at 4:11pm
Thanks for the reply... I haven't had a chance to get back to this yet, but will try it over the next few days and let you know how I get on


Title: Re: Using visual micro with Visual studio and github
Post by Bambo on Feb 26th, 2020 at 3:42pm
Hi, i currently have the entire visual micro and visual studio solution in a repository which i use on 2 different computers. It seems to work fine, when moving from one device to another, the IDE sometimes needs restarting but it works ok.

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