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 How to make a copy/duplicate of a project with all its code? (Read 7074 times)
bk13
Junior Member
**
Offline


Posts: 20
Joined: Aug 23rd, 2020
How to make a copy/duplicate of a project with all its code?
Sep 14th, 2020 at 9:59pm
Print Post  
Windows 10, latest updates installed. Visual Studio 2017.  Tool bar item vMicro, help, leads to the web pages with this:  Visual Micro - Release 20.09.10.1 - 11th September 2020 - VS 2017-2019, AS7

Summary:  What steps are needed to get VS to store a project on my D drive and to be able to return to it as a “previous” project or solution?

Details

Something I am doing prevents VS from saving and re-opening a project.   Here are the steps taken to create, then save, then attempt to reopen said project.
Start VS
File -> New -> Arduino Project
Enter a name:  “minimum”, click OK
Response: A folder with this name already exists.  Would you like to open the sketch if it exists.  Click OK, it opens the code that was started earlier.  The code does nothing but blink an LED.
Save the project as follows:
File -> Save minimum.io As….          Click it
Navigate to:  D:\visual_studio\projects and click Save
Do you want to replace: Yes
Close VS
VS prompts with: Save changes to the following items:  minimum.sln and minimum*
Click Yes
VS closes
Now try to resume, Launch VS
Click File -> Recent Projects and solutions
This solicits the display of one project:  ac_condensor_monitor.sln ( C:\Users/bryan/documents….)
I expect to find the most recent project, the one just saved named “minimum”  
So just to check:  Tools -> Options -> Projects and Solutions -> Locations
Look in field: Projects location to find: D:\visual_studio\projects
The next two fields: User project templates location:  and User item templates location:  were left at the initial values.
What must be done differently to save a solution/project in my selected directory: D:\visual_studio\projects
« Last Edit: Sep 15th, 2020 at 2:57pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Save and reopen project.
Reply #1 - Sep 14th, 2020 at 10:13pm
Print Post  
Saving a single file is not saving a project and is not saving a solution. If you want to move or copy an entire project I suggest you use windows explorer.   

Remember that an Arduino project must be a folder containing an .ino of the same name.

myProject\myProject.ino

Therefore "File>Save As" doesn't really do what you need UNLESS you ensure you save myProject.ino into a new folder of same name. After that you would need to use "File>Open Arduino Project" one time so that you can open the .ino and have a project and solution created for you automatically. If you don't want to use "File>Open Arduino Project" then you can always add a new empty vc++ project to the same folder and then "Include" the .ino and source code into your new project. In that case the project you create should also have the same name as the master .ino and the folder.






  
Back to top
WWW  
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 20
Joined: Aug 23rd, 2020
Re: Save and reopen project.
Reply #2 - Sep 15th, 2020 at 12:51am
Print Post  
Thanks for the reply.
Looking as carefully as possible, there is no method to to accomplish:
Quote:

Save Solution As ...

What is there, does not tell the user where to find the existing solution.  So to keep all projects off the C drive, the user must create a new project, hunt it down, then copy the directory over to the D drive (D for example)

This is a problem that I had hoped that moving to Visual Studio would correct.  I have used VS for many years and until now it did not require that source code be named the same as the enclosing directory.  That is not a real onerous requirement, but it is basically without merit.

And just to state the other problem explicitly:  There is no method to save a project where the user wants it saved.  The reason for this should be obvious.  Never keep your important data on the operating system drive.

End result:  VS is a better environment that Genuino, so far.  (Except that I cannot get it to work, but that's another thread here.)  But it does appear to propagate some of the problems / idiosyncrasies of Genuino.  I did, and continue to, expect better in this much more mature environment.

Again, thanks for your reply.
« Last Edit: Sep 15th, 2020 at 12:52am by bk13 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to make a copy/duplicate of a project with all its code?
Reply #3 - Sep 15th, 2020 at 2:58pm
Print Post  
Okay thanks, you are asking how to copy/duplicate an entire project. We will add a menu item into the next release that does same as Arduino IDE SaveAs.
  
Back to top
WWW  
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to make a copy/duplicate of a project with all its code?
Reply #4 - Sep 17th, 2020 at 2:33pm
Print Post  
This is great. Very fast to publish new version: Datatypes in STM32 are recognized. 
IDE "Save as" added. Congratulations! Thank you!
Worth to buy.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to make a copy/duplicate of a project with all its code?
Reply #5 - Sep 17th, 2020 at 6:19pm
Print Post  
Great yes we will look at it. There is a lame workaround, in visual micro if you right click the .ino file and select "Rename". Then visual micro will rename the folder and files/code as required. Therefore you can use that in various ways alonside windows explorer to copy/paste and rename projects.
  
Back to top
WWW  
IP Logged
 
Acuario
Full Member
***
Offline


Posts: 233
Location: Spain
Joined: Aug 28th, 2015
Re: How to make a copy/duplicate of a project with all its code?
Reply #6 - Oct 25th, 2020 at 4:38am
Print Post  
You could also use the 'Project/Export template..' option of VS to create a template from the project. You can then use this template as the base for a new project with a new name.

I used this in the past (2 or 3 years ago) BUT there was a problem that not all the files were included in the template (an MS problem I reported). I don't know if this has been fixed as I've not tried recently.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint