Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Buildalyzer" Version="3.2.2" />
<PackageReference Include="Buildalyzer" Version="3.2.6" />
<PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Buildalyzer" Version="3.2.5" />
<PackageReference Include="Buildalyzer" Version="3.2.6" />
<PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
<PackageReference Include="Microsoft.Build" Version="16.11.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' or '$(TargetFramework)' != 'net5.0' ">
Copy link
Contributor

@hyabean hyabean Dec 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asbjornu @arturcic

The "or" should be "and". Some unit tests failed on local machines.
Why not use some config for all targetFrameworks?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use some config for all targetFrameworks?

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unit tests failed on my local machine, which environment is Windows 10 and Visual Studio 2022. The reason is the Buildalyzer 3.2.5 reference to Microsoft.Build.dll version 16. So the project references to Microsoft.Build.dll version 16 and Microsoft.Build.Framework.dll version 17. But I'm confused why the CI is success.
企业微信截图_16406686232785
1640776019(1)

I don't know why you use different package versions for .net core 3.1 and net5.0 in commit bb243bc
But I founded that the failed unit tests run success by replacing

    <ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
        <PackageReference Include="Buildalyzer" Version="3.2.2" />
        <PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
        <PackageReference Include="Microsoft.Build" Version="16.9.0" />
    </ItemGroup>

    <ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
        <PackageReference Include="Buildalyzer" Version="3.2.5" />
        <PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
        <PackageReference Include="Microsoft.Build" Version="16.11.0" />
    </ItemGroup>

    <ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' or '$(TargetFramework)' != 'net5.0' ">
        <PackageReference Include="Buildalyzer" Version="3.2.5" />
        <PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
        <PackageReference Include="Microsoft.Build" Version="17.0.0" />
    </ItemGroup>

with

    <ItemGroup>
        <PackageReference Include="Buildalyzer" Version="3.2.5" />
        <PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
        <PackageReference Include="Microsoft.Build" Version="17.0.0" />
        <PackageReference Include="Microsoft.Build.Framework" Version="17.0.0" />
    </ItemGroup>

.

<PackageReference Include="Microsoft.Build.Framework" Version="17.0.0" />
is added to fix the version conflict of Microsoft.Build.Framework.dll and Microsoft.Build.

<PackageReference Include="Buildalyzer" Version="3.2.5" />
<PackageReference Include="Buildalyzer" Version="3.2.6" />
<PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
<PackageReference Include="Microsoft.Build" Version="17.0.0" />
</ItemGroup>
Expand Down