Skip to content

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

Closed

Description

@DynConcepts

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>

Activity

  1. DynConcepts commented on Jan 2, 2021

    @DynConcepts
    Author

    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...

  2. 3F commented on Jan 2, 2021

    @3F
    Owner

    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:

  3. Repository owner locked and limited conversation to collaborators on Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions