none
Lose Project references when cloning project from Github RRS feed

  • Question

  • Me and my team here are trying to work on a project that is on github. However, when i clone the application into visual studio my project loses all of its references and i then have to re-add the references again.

    After re-adding the references the project see's this as if ive made changes to the master branch and i cannot branch of the master as i have un-commited changes.

    So, my question is, is there a way to clone/download this appliaction without losing references?

    Thanks,

    Mark

    Monday, March 2, 2020 3:46 PM

All replies

  • Hello,

    The only time that GitHub cloned repositories should be without references is for NuGet packages the first time cloned and are refreshed via solution explorer right click top node, select restore NuGet packages.

    Standard .NET references (e.g. System.Data, System.Windows.Forms) as long as they are on the box which cloned the repo cause zero issues unless there is something unusual going on.

    This should go for any type of project if you can currently fix them manually. 

    Try cloning this repo and see if you can build it, no reason to run.

    https://github.com/karenpayneoregon/GenericsSharp


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Monday, March 2, 2020 4:24 PM
    Moderator
  • You can use TFS Express that is free. You can install it  on a central computer,  and all the developers can use it remotely. It supports 10 concurrent connections. I have used GitHub sparingly,  and I really didn't like it, becuase I have used TFS at home and professionally for many many years. Project references are not lost that's for sure.
    Monday, March 2, 2020 4:26 PM
  • Hi thanks for your response.


    I apologise i should have been more clear about the references that were missing. Once i clone the repo i do a clean and rebuild and this sorts it for the most of the issues with references.

    We have a load of DevExpress references that, even after the clean/build are still missing. Have you any suggestions as to why we would be losing these references?

    Monday, March 2, 2020 4:41 PM
  • Hi thanks for your response.


    I apologise i should have been more clear about the references that were missing. Once i clone the repo i do a clean and rebuild and this sorts it for the most of the issues with references.

    We have a load of DevExpress references that, even after the clean/build are still missing. Have you any suggestions as to why we would be losing these references?

    You should not have to do a clean, simply a rebuild. Can't say about DevExpress unless it's part of the GAC rather than a local reference.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, March 2, 2020 6:31 PM
    Moderator
  • Project references or NuGet references?

    Project references are relative paths from the current project to the other project in the same solution. Provided the repo contains all of the projects then this just works.

    NuGet references are restored after the solution loads but before you can build by default. It may take a while the first time as it has to pull everything down and cache it. If you're using the traditional packages.config then the packages are stored in a per-solution Packages folder that gets created. You'll never check this into source control but once the package has been cached locally by NuGet on your machine at least once it becomes a file copy so is fast. 

    For package references the packages are cached at the machine level so they are available after they have been downloaded at least once.

    You can track the status of package restore in the output window under the appropriate category.

    If any package cannot be found you'll get an error in the output window you can look at. If you aren't sure if the reference is a NuGet, binary or project reference then open the project file and find the reference. binary references are just assembly names with a `HintPath`. Project references follow the same pattern but will refer to a project instead. NuGet packages are binary references but the path will be to the packages folder. Package references use the PackageReference element and won't have any path as it isn't needed.


    Michael Taylor http://www.michaeltaylorp3.net

    Monday, March 2, 2020 6:35 PM
    Moderator