3F / MvsSln

🧩 Customizable VisualStudio .sln parser with project support (.vcxproj, .csproj., …). Pluggable lightweight r/w handlers at runtime, and more …
MIT License
135 stars 27 forks source link

Getting the Assembly that will be produced by a .NET project... #35

Closed DynConcepts closed 3 years ago

DynConcepts commented 3 years ago

PRetty sure I am missing, but I have spend a few hours, and just don't see it as a property of the Project type classes.

background: I am processing a huge system. Assembly references rather than project references are used. I need to generate the association between the proj file that creates and assembly and the proj file(s) that reference it...

Thanks in advance.

3F commented 3 years ago

https://github.com/3F/MvsSln/blob/9ce5885282d65ee32bfc03808c83c1113c1928e3/MvsSln/Core/IXProject.cs#L356

And everything related to its metadata if you need

https://github.com/3F/MvsSln/blob/9ce5885282d65ee32bfc03808c83c1113c1928e3/MvsSln/Projects/Item.cs#L61

You can also access to AsmData helper https://github.com/3F/MvsSln/blob/9ce5885282d65ee32bfc03808c83c1113c1928e3/MvsSln/Projects/Item.cs#L91-L97

If you need a type of the .NET projects,

In 2.5.3 you may note the following:

DynConcepts commented 3 years ago

Thanks... I must be being dense.... The AsmData (Assembly) appears to be on an Item type...

What I am looking for (ideally in a project type invariant manner (i.e. the details are encapsulated) is related to:

image

3F commented 3 years ago

This is called property in the context of msbuild. You just need access to the AssemblyName property. Easy to use: https://github.com/3F/MvsSln/blob/9ce5885282d65ee32bfc03808c83c1113c1928e3/MvsSln/Core/IXProject.cs#L180-L183

Note the 2 different values in PropertyItem:

The evaluation of the nodes is recursive (ie. each property can contain other properties, and so on); this is part of the msbuild (MvsSln 2.x). But even for 3.0 with IeXod it should follow the same rules.

// ~
xp.GetProperty("AssemblyName").evaluatedValue == "VSDependencies"
3F commented 3 years ago

hmm,

/// <returns>null if no property of that name and scope exists.</returns> 

looks like a typo o_o

DynConcepts commented 3 years ago

Thanks that was what I could not find. Since it is surfaced so hig in the VS UI, and also a "key group" my mind sort of expected a dedicated Property... Thanks again.