3F/MvsSln

DEaling with Properties in .??proj when the original definition is in a nested .props file...

DynConcepts opened this issue · 2 comments

My goes is (still) to identify settings, be able to report on them, then be able to standardize them.... Hereis an example along with the error i am getting...

image

Also, many properties that are defined in a nested .props fail I have been unsuccessful in finding...

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup>
    <Midl>
      <HeaderFileName>%(Filename).h</HeaderFileName>
      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
    </Midl>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>

Then in the vcxProj...

  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Typelib|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="..\..\..\..\Bldtools\PropertySheets\CustomLevel1.Typelib.Win32.props" />
    <Import Project="..\..\..\..\Bldtools\PropertySheets\CustomLEeel2.Typelib.Win32.props" />
  </ImportGroup>

PRogress of a sort... For now I have been able to "override" the property (when it is found) by adding it to the .vcxProj.... This will "Get me through the night (darn, it is almost morning), and even through the (holiday) weekend....

But this is a poor solution as desired value not occurs in each relevant .vcxproj (literally 4000+) rather that in one single .props file...

3F commented

Because you're really trying to work with different nodes. Process of the evaluation is recursive as I was sayng earlier. And historically you need to process this separately if you want to modify something deep below other nodes (different parent).

MvsSln provides even this

/// True if the property originates from an imported file
/// and not from an environment variable, a global property, or a reserved property.
/// </summary>
public bool isImported;

And this

/// <param name="localScope">If true, will return default value for any special and imported properties type.</param>

Try to use some cheat sheet from this projects: