Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Support $(Platform) condition references? #254

Closed
@kirsan31

Description

Hi. If csproj contains $(Platform) condition references like:

  <!-- x86 specific referneces -->
  <ItemGroup Condition=" '$(Platform)' == 'x86' ">
    <Reference Include="lib">
      <HintPath>..\tstlib\lib.dll</HintPath>
    </Reference>
    <!-- any additional x86 specific references -->
  </ItemGroup>
  <!-- x64 specific referneces -->
  <ItemGroup Condition=" '$(Platform)' == 'x64' ">
    <Reference Include="lib64">
      <HintPath>..\tstlib\lib64.dll</HintPath>
    </Reference>
    <!-- any additional x64 specific references -->
  </ItemGroup>

then tool will fail with:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Immutable.ImmutableDictionary`2.get_Item(TKey key)
   at MSBuild.Conversion.Project.ProjectRootElementExtensions.RemoveOrUpdateItems(IProjectRootElement projectRootElement, ImmutableDictionary`2 differs, BaselineProject baselineProject, String tfm) in /_/src/MSBuild.Conversion.Project/ProjectRootElementExtensions.cs:line 195
   at MSBuild.Conversion.Project.Converter.ConvertProjectFile() in /_/src/MSBuild.Conversion.Project/Converter.cs:line 69
   at MSBuild.Conversion.Project.Converter.Convert(String outputPath) in /_/src/MSBuild.Conversion.Project/Converter.cs:line 28
   at MSBuild.Conversion.Program.Run(String project, String workspace, String msbuildPath, Boolean diffOnly, Boolean noBackup) in /_/src/try-convert/Program.cs:line 85

image

But such, condition references work well in .NET Core too. So, I think try-convert need to transfer them as is...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions