Results 1 to 20 of 20

Thread: vs 2019 vb.net .vb How can I clone my project under a new name ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    vs 2019 vb.net .vb How can I clone my project under a new name ?

    Hello & Thanks ;

    My code is getting messy from testing alternatives .
    vs 2019 vb.net .vb How can I clone my project under a new name ?

    Thanks for your Help...

  2. #2
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    copy the whole folder under a new name then If I remember correctly, you change the name of the project folder, the name of the .sln file and .vbproj file then you need to open the .sln file (with any editor) to change yourself the name of the .vbproj file and project folder
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by Delaney View Post
    copy the whole folder under a new name then If I remember correctly, you change the name of the project folder, the name of the .sln file and .vbproj file then you need to open the .sln file (with any editor) to change yourself the name of the .vbproj file and project folder
    THanks ,
    That sort of worked ,
    I manually opened Form1.vb and Form1Designer.vb
    but couldnt get the Form1[Designer].vb to open .
    So I cant add/change/delete any Form Controls .
    Is there a way to open Form1[Designer].vb ?
    Thanks

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    You're doing it wrong. You should be using source control. That will provide numerous benefits, including ensuring that you always have a backup of your project to fall back on. You can also create new branches to experiment with alternative scenarios without affecting the main branch. As an example, let's say that you want to test three ways of doing something. You could create three new branches and test one option in each. The main branch is unaffected so, if none work, you simply delete the branches and your code remains as it was. If one option proves to be desirable, you merge that branch back into the main branch and then delete the other branches. It also means that, if you release your application, you can maintain a branch with the source code in that state while adding new functionality in the main development branch. If a user reports a bug, you can fix it in the branch that corresponds to the version that they are using. Stop making your life harder and start using source control now. An Azure DevOps account is free and support is built right into VS 2019. There's also support for GitHub accounts and you can use various other providers too.

  5. #5
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    I hadn't done it in a long time so I gave it a try.

    In a folder named "AJunk2017" is where the .sln and associated file were, under was subfolder where the form/designer/classes/moduals.... files were.

    All I had to do was create a new folder "A2017" then open "Ajunk2017" and copy all files and subfolders to "A2017".

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by wes4dbt View Post
    I hadn't done it in a long time so I gave it a try.

    In a folder named "AJunk2017" is where the .sln and associated file were, under was subfolder where the form/designer/classes/moduals.... files were.

    All I had to do was create a new folder "A2017" then open "Ajunk2017" and copy all files and subfolders to "A2017".
    Yeah, there's no specific need to change anything. You can open two solutions with the same name and projects with the same name from two different locations. The SLN file contains relative paths to all the projects so, as long as you don't change the folder hierarchy within the solution, everything will just work after copying or moving the whole lot.

  7. #7
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by vmars316 View Post
    THanks ,
    That sort of worked ,
    I manually opened Form1.vb and Form1Designer.vb
    but couldnt get the Form1[Designer].vb to open .
    So I cant add/change/delete any Form Controls .
    Is there a way to open Form1[Designer].vb ?
    Thanks

    You don't need to change the name of the form but if you want to do it, do it in VS, select the form, right click and rename command
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  8. #8
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by jmcilhinney View Post
    You're doing it wrong. You should be using source control.
    Is there source control application that are not online ?
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by Delaney View Post
    Is there source control application that are not online ?
    Sure. I would imagine that they would all require a server but you can install that server yourself in some instances; possibly all. We used to use Subversion (SVN) in my office before we moved to DevOps and we had VisualSVN server installed on-premises. I'm not sure that there's a good SVN extension for VS these days though, as the AnkhSVN that we used to use was not being updated by the time we stopped using it and there was another one but it was very basic. You can use TortoiseSVN to manage your source in File Explorer though. I've not looked into it but I would assume that you can install your own Git server locally too, and I expect that you can integrate that into VS, possibly via Team Explorer or maybe with a separate extension. There may well be other options too.

    Note that one of the useful things about a cloud provider is that you can access your repositories from any machine in any location. If that's of use to you then I'd definitely suggest a cloud provider. If you only ever use one machine and especially if you only ever use it in one location then a cloud provider may not be so attractive but you still have the benefit of not having to setup and maintain a server. Note that that means server software, which might be on the same machine you develop on, and not separate server hardware. Many providers will also support local commits without syncing to the server, so you can still work on a laptop that is away from the network on which the server resides and make commits, pushing them to the server the next time your back on that network.

  10. #10
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Thank you for the information and orientation. I will look to all these and see what I can implement.

    regards
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  11. #11
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by jmcilhinney View Post
    Note that that means server software, which might be on the same machine you develop on, and not separate server hardware. Many providers will also support local commits without syncing to the server, so you can still work on a laptop that is away from the network on which the server resides and make commits, pushing them to the server the next time your back on that network.
    I'd still be leary of using your local dev machine as the "remote" repo ... things happen. And this is 2020, which does not have a great track record at the moment (I mean we're 9 eps deep and it's not looking good for most of our heroes... hopefully they can pull it out in the last 3 eps before the finale) .... if something happens to the machine and it crashes and becomes unrecoverable... that defeats part of the purpose of source control. But if it's not something you're concerned about, eh, then by all means, fell steam ahead. Just be aware of the consequences.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  12. #12

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by jmcilhinney View Post
    Yeah, there's no specific need to change anything. You can open two solutions with the same name and projects with the same name from two different locations. The SLN file contains relative paths to all the projects so, as long as you don't change the folder hierarchy within the solution, everything will just work after copying or moving the whole lot.
    Not working for me , still can't bring up Form1.[Designer.]vb .
    Ugh...

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Quote Originally Posted by vmars316 View Post
    Not working for me , still can't bring up Form1.[Designer.]vb .
    Ugh...
    If you have a working solution and you copy the entire solution folder then there's no reason that the copy should not work the same. If it doesn't work for you then, in the absence of any other relevant information, I can only conclude that you did not copy the solution folder.

  14. #14

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Thanks ;
    win 10 vs 2019
    I have a repos folder called 'CompareTxtBox-TxtFile' .
    Within that there are 4 more folders named
    .vs , bin , My Project and obj .
    Which of these are you calling 'solutions folder' ?

    I copied 'CompareTxtBox-TxtFile' to a new Folder called 'CompareTxtBox-TxtFile-01' then on Open Recent screen , I click on 'open project or solution' .
    THen open dialog shows CompareTxtBox-TxtFile.sln and 'CompareTxtBox-TxtFile.vbproj' . When I open one of these , up pops vs ide , with nothing in it .
    Pls , what next ?

    Thanks

  15. #15
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Post Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    that's the folder above this one that you must copy .

    the structure of any project is like this

    Projetname (folder with) <-- this is the one you must copy with a new name, other files/folder will have the same names
    *ProjetName (folder with)
    Bin(folder)
    My project(folder)
    Obj(folder)
    « Other folders eventually »
    *ProjetName.vbproj
    Form1.vb
    Form1.designer.vb
    Form1.resx
    « Other files eventually »
    *ProjectName.sln
    .vs (hidden)

    you can eventually change the name of the folder and files with a * before the name (they must all have the same new name) but you will have to open the .sln file to change manualy the former name of files and folder in it with the new name
    PS: the * doesn't exist in reality, it is just to identify the files and folder in the structure above

    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  16. #16

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Yes/No question ;
    I have a repos folder called 'CompareTxtBox-TxtFile' .
    Is 'CompareTxtBox-TxtFile' Folder the same as Project Folder ?
    Thanks

  17. #17
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Open your project in VS and open the Solution Explorer. Is the project at the top level or is there a solution at the top level? If I remember correctly, VB projects do not display the solution by default. I suggest that you change that in the IDE options to always display the solution.

    If the solution is there, right-click it and select Open Folder in File Explorer. That will open the solution folder, containing your solution file and everything associated with that solution. It is that folder that you need to copy, so navigate up one level and then copy that solution folder to another location. You can then open the new folder and open the SLN file in VS.

    If there is no solution displayed in the Solution Explorer then right-click your project and select the same option. You will now be in the project folder, which is one level below the solution folder. Navigate up one level to the solution folder and then follow the instructions above. If you simply copy the solution folder then there is no reason that I'm aware of that everything should not just work as is. I've done this myself many times and it has never failed.

  18. #18

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Aha!
    Thanks
    I found the Form1[Designer].vb via the SolutionExplorer Here;
    Attachment 178773
    Located Here;
    \source\repos\CopiesOF\DanielZhangSolution
    To open solution files I had to 'open Form1'
    then to open Form1.vb I had to 'double-Click' on a control in Form1.vb[Designer] .
    Then It works fine as named .

    When I changed 'solution name' in SolutionExplorer ,
    then I was not able to save or load solution .

    So I guess I will have to live with the 'same name Solution' ,
    but in diff Folder .
    Thanks for your Help...
    Last edited by vmars316; Sep 17th, 2020 at 09:11 AM.

  19. #19

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Btw: jmcilhinney ;
    I find your 'Beginner Tutorials .vb' quite useful .
    Thanks

  20. #20

    Thread Starter
    New Member
    Join Date
    Sep 2020
    Posts
    10

    Re: vs 2019 vb.net .vb How can I clone my project under a new name ?

    Hello ;

    Just wanted to give an update .
    Even after all the above , when I ran the program ,
    the original .sln name showed up in heading of MsgBox title , etc. .
    So I ran InfoRapid-search-replace https://www.inforapid.de/html/searchreplace.htm against all non-binary files
    to replace the name GetElementByTag with SafeBrowser .
    And that seemed to thoroughly get rid of all old names .

    Thanks for your Hep...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width