msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Solution file section: SharedMSBuildProjectFiles

Open jaredpar opened this issue 10 years ago • 4 comments

Can anyone shed some light on what this entry in a SLN file represents?

GlobalSection(SharedMSBuildProjectFiles) = preSolution
  src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4

There are three items of interest here:

  1. src\Test\Utilities\Shared\TestUtilities.projitems: This is a valid shared project used in the solution.
  2. 76c6f005-c89d-4348-bb4a-391898dbeb52: This is a GUID of a real project that uses the shared project.
  3. SharedItemsImports = 4: No idea. In other cases it's 13.

In particular I'm curious about the following:

  • Why is the GUID of a real project listed here for a shared project? Is there just one entry for every real project that references the shared project?
  • What does 4 / 13 represent here? In cases where a project is listed several times one seems to have 13 while all the other instances have 4.

jaredpar avatar Mar 29 '16 21:03 jaredpar

I'm unfamiliar with it. Looking at src\vscommon\idl\vsshellprivate121.idl in our super secret internal VS repo (around line 500), I see some interesting comments

// This is an invisible, Solution-scoped hierarchy that coordinates all shared
// project files that are registered.
//
// The only user visible manifestation of this hierarchy is in the SaveChanges dialog where it appears
// with the name "[Shared MSBuild Project Files]" or something similar. This node will appear
// in the SaveChanges dialog when there are shared MSBuild files that need to be saved and the 
// files are not managed as having affinity to a particular shared MSBuild file using project.

I don't think MSBuild handles this in any way, so you'll have to ask the VS project system folks about the details. I'm curious, too, if you want to include me on the mail :innocent:

rainersigwald avatar Mar 29 '16 22:03 rainersigwald

The 4 is for a project that references the shared project, The 13 is the shared project itself.

daryllabar avatar Jan 31 '19 22:01 daryllabar

@daryllabar Why do we need add shared project itself in this section?

sergey-guk-dev avatar Jun 19 '19 14:06 sergey-guk-dev

Don't ask me @eventpromo, I didn't design it. Just figured out what it is for.

daryllabar avatar Jun 20 '19 04:06 daryllabar