Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseMSBuildTestInfrastructure doesn't work for multi-tfm #37712

Closed
MarcoRossignoli opened this issue Jan 2, 2024 · 0 comments · Fixed by dotnet/msbuild#9583
Closed

UseMSBuildTestInfrastructure doesn't work for multi-tfm #37712

MarcoRossignoli opened this issue Jan 2, 2024 · 0 comments · Fixed by dotnet/msbuild#9583
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Jan 2, 2024

This PR added the support for the /t:Test target to msbuild dotnet/msbuild#9193 and the target it's imported using the prop UseMSBuildTestInfrastructure

Now that's landed inside the .NET SDK I'm trying to use it and it's working as expected for single tfm.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
</Project>
dotnet msbuild /t:Test -p:UseMSBuildTestInfrastructure=true
MSBuild version 17.10.0-preview-23615-03+abc2f4620 for .NET

But it's failing for multi-tm

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net9.0;net8.0</TargetFrameworks>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
</Project>
 dotnet msbuild /t:Test -p:UseMSBuildTestInfrastructure=true /bl
...\msbuildtest.csproj : error MSB4057: The target "Test" does not exist in the project.

Digging deeper into it I've noticed that the Microsoft.Common.Test.targets is imported only in case of single tfm
Imported
NotImported

cc: @Forgind @rainersigwald @novacole @Evangelink @nohwnd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant