(Maybe) best practice: Use shared projects in Visual Studio involved with Nuget

I wrote many solutions in Visual Studio. Some of them includes components, which intend to be published to Nuget.

Previously, I wrote these projects directly and publish them to Nuget. This is not a smooth way. Consider this: You have project A need to be published to Nuget. Project B, as well. Project C need to reference project A and B, and also need to be published to Nuget. Project D need to reference C for testing. Obviously, following Nuget standard, the Project C need to reference A by using Nuget Packages instead of the projects of A and B directly. But it seems that there is no called testing mode publishing in Nuget supported. There is no easy way to test your project before publishing to Nuget. Maybe you need to change the references in Project C and D repeatedly, switching mode between testing and publishing.

Recently, Shared Project support added to Visual Studio. Now I use a better way, IMHO, in developing such a solution mentioned above.

Create a shared project for each project need to be published to Nuget.