Renaming a project and path

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

I copied a solution to make a new project, but then wanted to change the name.  That's easy enough - just edit the solution name and the project name from the solution explorer window.

My question is, how do I edit the internal path that shares the name of the original solution?

 

i.e. the (abbreviated) structure looks something like:
\.vs  

     \ProjectA

          \v14

               .atsuo

\ProjectA
     ProjectA.cproj
ProjectA.atsln

 

If I rename the solution and project I end up with:

\.vs  

     \ProjectB

          \v14

               .atsuo

\ProjectA     <--------Note
     ProjectB.cproj
ProjectB.atsln

 

 

How do I update the directory name to ProjectB without breaking everything?

 

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

I recently copied a solution to a new folder.  I copied every atmel file including the atsuo.  After changing the .sln and .proj files, it builds okay.  The atsuo file still has the same date from 2017.

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

I should add that my new folder is a sibling of the old one.  So any file paths don't change.

 

I think the atsuo file only contains user preferences so it shouldn't change.

 

If the new folder is not a sibling of the old one, then the include paths may need to change.  Right click on the project name >>  Properties >>  Toolchain >>  Directories.

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

Not in AS7 but in VS2015/VS2017 I often just edit the XML if something needs moving or renaming. While I suppose there's some way to achieve the same in the GUI I am officially a luddite.

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

clawson wrote:
Not in AS7 but in VS2015/VS2017 I often just edit the XML
Is this Visual Studio?  I don't have a .xml file in Visual Studio.

 

I am having an irritating glitch with Visual Studio 2019 though.   I did the same copy of a VS project to a sibling folder and it builds and runs fine,  However I lost all the filters.  All the files in the project are in one big pile.  It seems I will have to add the filters and drag the files into the appropriate filters.

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

steve17 wrote:

Is this Visual Studio?  I don't have a .xml file in Visual Studio.

Yes it is in Visual Studio. That uses .sln as the main solution file and .vcxproj as the individual project files. In AS7 they use .atsln for the solution and .cproj for the individual projects.

 

ALL these files are XML internally. For example this is an AS7 .atsln file:

D:\test>type test.atsln

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "test", "test\test.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|AVR = Debug|AVR
                Release|AVR = Release|AVR
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
                {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
                {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
                {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
                {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
        EndGlobalSection
EndGlobal

So this is a solution with one project called test.cproj and then that test.cproj is further XML...

D:\test\test>type test.cproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
  <PropertyGroup>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectVersion>7.0</ProjectVersion>
    <ToolchainName>com.Atmel.AVRGCC8.CPP</ToolchainName>
    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
    <avrdevice>ATmega8</avrdevice>
    <avrdeviceseries>none</avrdeviceseries>
    <OutputType>Executable</OutputType>
    <Language>CPP</Language>
    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
    <OutputFileExtension>.elf</OutputFileExtension>
    etc etc.

That one is considerably longer that I show as it has all the settings from all the project properties and a list of all the source files and so on but the above simply demonstrates that all these things are human readable (and most importantly "editable") XML text. So if you can't create the directory/file naming and structure you want in the IDE itself you can go in "behind its back" and edit the details in these files anyway.

 

Obviously do NOT mess with things like GUIDs that glue everything together !

 

(if you do this in a "git diff" merge then that can start to be quite a problem in fact)

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

steve17 wrote:
However I lost all the filters. 
 

VS2015/2017/2019 filters are in neither the .sln or the .vcxproj files. They are a third XML file called <projname>.vcxproj.filters so did you lose those files in the move?

 

 

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

clawson wrote:
They are a third XML file called <projname>.vcxproj.filters so did you lose those files in the move?
No, it is there.  There is also a <projname>.filters file dated 2017 that is probably left over from an earlier version of VS.

 

I think I was vaguely aware that the .sln etc. files were called xml.  The fact that Atmel has a file name that ends with .xml tripped me up.

 

I have been editing the .sln and .prog files for many years.  I would change the old solution and project names to the new ones.  Actually I use the same name for the solution and project.