Skip to content

Warn when any types of item conditions are used in legacy projects  #12729

Open
@nkolev92

Description

MSBuild conditions on PackageReference or ProjectReference don't really work in VS for legacy projects, so it might be a good idea to warn whenever these conditions are seen.

We have the capability to warn on the commandline, but this isn't something that's possible in all implementations.

Example, the following condition will not be respected in VS, but will be respected in the commandline.

<ItemGroup>
   <PackageReference Include="Newtonsoft.Json" Version="13.0.1" Condition=" '$(ShouldReferenceNJ)' == 'true' " /> 
</ItemGroup>

See dotnet/msbuild#8889
https://developercommunity.visualstudio.com/t/visual-studio-manage-nuget-packages-ui-does-not-re/721485

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions