Actually I forgot that there is an old way to create local libraries below the project I think in a libraries folder but it is more difficult to support.
Quote: - I can keep the name of the library referenced in the include the same? e.g.:
#include <spi.h>
Quote:Yes you can use same header names but do not have too. Ideally the name of a library folder shoould contain a header with same name but it's not ciritical.
MyLibraries\Lib1\v1x1\Lib1
MyLibraries\Lib1\v1x1\Lib1\library.properties
MyLibraries\Lib1\v1x1\Lib1\Src\Lib1.h
When you right click references in your Arduino project and add a "Shared Project" reference to your library this allows Visual Micro to use whatever libraries you have included as a preference to any other Arduino libraries so it is all within your control.
Quote:- duplicate and change the spi library folder name e.g.: spi_verXX?
Yes
Quote:- modify the library code but leave the filenames and references unchanged?
Up to you. If other libraries you use that are not editable shared projects also reference the library then you might want to use the same name to avoid confusion. For example if some other library you reference expects spi.h and you changed your copy of spi to something else then the spi library would be used in addition to your something else. It can be confusing but okay if you work in a clean manner hich might be making a copy of all libraries.
Quote:- add the modified library to the project using Add Library with the "Create Shared Project When Including Libraries" option checked?
The visual micro "add lib" menu is just to show you what to create and do. It doesnt do anything special behind the scenes. If you have a shared project and click that standard visual studio "Add Project" commands to add a shared library project to the solution then add a reference into your "arduino project > references" list and added one or more code #includes to your library then you have done manually what visual micro does.
Final Note The system is simple enough that you can use the standard VS File>New>Project dialog to create a new "Microsoft C++ Shared Code Project" unrelated to Visual Micro.
If you then add the library.properties, source code in the structure outlined here and then add the Reference from an Arduino project to the Shared Project. That has same end result, Visual Micro will treat the shared project as a standard Arduino library.