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 Duplicate and rename a project (Read 2582 times)
Egol
Junior Member
**
Offline


Posts: 16
Joined: May 17th, 2021
Duplicate and rename a project
Nov 14th, 2021 at 11:46am
Print Post  
Hello,
I'm using VS 2019 with VM and I have a project\solution that I want to duplicate and rename, how can I do that?
Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Duplicate and rename a project
Reply #1 - Nov 14th, 2021 at 12:19pm
Print Post  
There is a workflow to assist with the copy. We are looking at adding a "duplicate" to make this a single step process. For now you can do something like this...

  • Right click the project in the solution explorer and click "explore file location" (or right click the tab of a code file). In the explorer, make a copy of the project FOLDER. Such as "Project1_BAK".
  • Right click the Project_Name.ino in the solution explorer and click "Rename". That will rename the folder and the project_Name.ino ++, then it reloads the project.
  • Rename "Project1_BAK" folder back to "Project1"


« Last Edit: Nov 14th, 2021 at 8:54pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Egol
Junior Member
**
Offline


Posts: 16
Joined: May 17th, 2021
Re: Duplicate and rename a project
Reply #2 - Nov 14th, 2021 at 7:43pm
Print Post  
Hi Tim,
I'm working with VS2019 and when I try to follow those steps the flow does not follow what you described.
The project name in the solution change its name and that's it, no folder name is changing and no  reload occurs.
Any idea?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Duplicate and rename a project
Reply #3 - Nov 14th, 2021 at 8:55pm
Print Post  
Sorry I made mistake. I have altered the 2nd point. You have to right click the project_name.ino for the rename to work.
  
Back to top
IP Logged
 
Techlobo
Junior Member
**
Offline


Posts: 14
Joined: Sep 1st, 2022
Re: Duplicate and rename a project
Reply #4 - Oct 2nd, 2022 at 5:12am
Print Post  
Tim@Visual Micro wrote on Nov 14th, 2021 at 12:19pm:
We are looking at adding a "duplicate" to make this a single step process.


Did you ever get around to adding this capability (as its not obvious, at least to me)?

If not, do you have an anticipated timescale?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Duplicate and rename a project
Reply #5 - Oct 2nd, 2022 at 6:18pm
Print Post  
The "vMicro>Compiler>Export as Zip" option gives you a copy of the current project. If you grab a zip then rename the .ino to a new name, the zip will contain the old project.

For a simple arduino ide compatible project it is often just a matter of copying the project folder and renaming the folder and the "projectname".ino. Then use "File>Open>Arduino Project" to open the .ino file. That will automatically create a new visual studio project.

Advanced use tips ...

There isn't actually that much to copying a project unless you have a lot of complex share code or library links and want to move to a different relative path folder structure. 

After renaming or moving projects, the Viual Studio "Recent file lists" can become confused showing old file names and paths. You can remove the invalid entries but don't let them cause confusion. 

If you need to make major location changes and want to keep some complex compiler properties (or shortcuts to shared code/libraries) then edit the .sln, .vcxproj or .vcxitems. They are simple text files.

What is an Arduno compatible project?

Keep in mind that an arduino compatible project does not need the visual studio "extra" files that you see in the project. 

If a folder name and an .ino file name match, then that is considered to be an arduino project. 

In Visual Studio, we also have a project system. The project system (.vcxproj) helps with intellisense and is a place to store any custom properties such as selected board. Visual Micro expects the project name to match the folder and .ino file name.

  
Back to top
IP Logged
 
Techlobo
Junior Member
**
Offline


Posts: 14
Joined: Sep 1st, 2022
Re: Duplicate and rename a project
Reply #6 - Oct 4th, 2022 at 6:01am
Print Post  
I'll take that as a No!  Wink
  
Back to top
 
IP Logged
 
Techlobo
Junior Member
**
Offline


Posts: 14
Joined: Sep 1st, 2022
Re: Duplicate and rename a project
Reply #7 - Oct 4th, 2022 at 6:02am
Print Post  
Thanks for the workaround though - I'll give it a try.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint