How do I set up VS environment to to include (references) certain libraries in new project by default? RRS feed

  • Question


    Visual Basic 2015, .NET 4.0, WinForms


    I notice that when starting a project, certain libraries are automatically included in "References", while others have to be added after creating the project. Is there a way to set up the environment so as to add to or remove from the list of "automatic" references, so that certain libraries that I use frequently don't have to be manually added to "References" for every new project?

    I have a custom control which depends on a secondary library, basically requiring me to add that library to "References" before I place any instances of the control onto any forms in a "host project"; otherwise, the attempt fails with a big referencing error. Is there a way to set up the control so that adding it to a host project automatically adds the secondary reference(s)--i.e., so that if ControlX.dll (Public-ly) uses Library.dll, putting ControlX on a form will automatically add a reference in the host project to Library.dll too?

    Robert Gustafson

    Tuesday, December 24, 2019 7:09 AM


  • Hello,

    Create a project with the required library then select Project menu, then "Export template". This allows the project to be available.

    The other option is to create a NuGet package and host it locally (Hosting your own NuGet Feeds). This is a more advance option. 

    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.

    profile for Karen Payne on Stack Exchange

    Tuesday, December 24, 2019 9:32 AM