How to Rename a project in Atmel Studio 7

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Group,

 

Say you created a project and saved it.

Then you make changes to the project.

 

How do you save the project (Solution) under a different name?

You can Save As a "C" file, just not the whole solution.

 

You could start a New Project and copy in the main program file but that's a lot of work and prone to error. 

 

Thanks for your help,

Paul

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can rename the solution & project(s) in the Solution Explorer - it's in the right-click menu.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also you can create a "template" then creates a whole new solution / project from that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 

Sorry, I could not let it go.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Well, that does some of the job.

 

The project folder name and path also need to be changed.

 

You can easily change the folder name, but the path will be broken.

You can see the path to the Solution File by looking at the Properties of the project, but you can't change the path. 

 

If you edit the .atsln file (which is an .xml file) and change the folder name and path it works, but it's a lot of effort to do all this and prone to errors. 

 

I'm a old hardware engineer that writes software, maybe everybody works differently than I do! 

I just think it seems strange that there is no easy way to do this.

 

Thanks everyone for your input.

Paul

 

 

 

 

 

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



You can easily change the folder name, but the path will be broken.

Not entirely sure I follow your point. I just picked a project and used right click to change both the solution and the project names:

 

 

and this still builds exactly as it did before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you are correct Clawson, they rename fine and still build as they did before. 

However, the renamed project is still in the folder with the original name. 

 

In many cases this may be alright. 

The problem is, I started with an example project using the default name and built from there.

The folder name is still the example project name. 

 

Note to self!

Use the desired name in the beginning!

 

Regards,

Paul

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


PaulieT wrote:
However, the renamed project is still in the folder with the original name. 
Indeed. A lot of people make the mistake (because they often look the same) of thinking Solution/Project layout hierarchy is the same as directory/filename hierarchy on disk - but of course they are two completely different things.

 

In Visual Studio I personally use "filters" a lot to group connected files even though their actual locations may be all over the place.

 

In your case you are probably right - abandon what you have, first create a directory structure you like then create a new (correctly named) solution/project and import the files into ("add existing...")

 

PS looking at AS7 it's kind of annoying that it has:

 

 

but not:

 

 

which is the equivalent in Visual Studio - filters ("virtual groups") are far more useful than real folders to my mind !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PaulieT wrote:
The project folder name and path also need to be changed.

No, they shouldn't.

 

All the paths in the project should be relative.

 

So you just pick up the top-level folder of the original Solution, and copy it to its new location.

 

Then open the Solution in its new location, and do the renames of Solution & Project(s).

 

That's all I do.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
All the paths in the project should be relative.
yeah but when you created the "foo" project\solution it created a "foo" subdirectory too. You may now rename the project to "bar" but while the bar.cproj may well contain relative paths they are still to foo\whatever

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I wrote the title of this post is incorrectly.

I don't want to just Rename the Project, I want to save the Project as something new.

This way the Original Project and the New Project could co-exist.

 

The way "Save As" works in other programs. 

 

Paul

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes - that's exactly what I was talking about.

 

It works for me as I described.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks everyone for your comments and suggestions.

 

Have a great day,

Paul

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


BTW did you explore...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually I never tried exporting a project as a template.

 

Looks like it might work. 

 

I'm going to give it a try.

 

Thanks,

Paul 

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is what I was suggesting in #3 ;-)

 

(sorry if it was not clear - posts from mobile phone tend to be "terse" !)