I am developing an application (C#) which would read project properties/references (and properties of the references) from multiple csproj files, and modify their values.
However, the Reference properties like "copy-local" (the properties you see in the properties explorer when you click on a reference) cannot be found in those csproj files. Is there a way I can access them and modify their values programatically?
Everything is in the XML project file - there's not really anywhere else that this information could be, and it has to be somewhere, right?
Here's an example I've quickly done for you. Copy Local is true by default for framework assemblies. When you set Copy Local to false, you get an XML element named private included for that reference which itself is set to false.
In this example System.Core is set Copy Local = false.
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With