testfx icon indicating copy to clipboard operation
testfx copied to clipboard

Nitpick: `dotnet test` with MTP shows incorrect target framework version

Open bradwilson opened this issue 1 month ago • 4 comments

Describe the bug

Image

You can see here that dotnet test is showing this as net48, when it's clearly net472. I don't know if this a difference between "the target framework you built with" vs. "the framework we're running with" (because you could say the same thing for x64 vs. AnyCPU).

This is a nitpick for me. Not sure how important it is for other users.

bradwilson avatar Dec 06 '25 18:12 bradwilson

I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  • https://github.com/microsoft/testfx/issues/3669

MihuBot avatar Dec 06 '25 18:12 MihuBot

@MihuBot This is not the same issue, though they are similar.

bradwilson avatar Dec 06 '25 20:12 bradwilson

@nowhnd Could you please have a look at this issue?

Evangelink avatar Dec 07 '25 10:12 Evangelink

Cause for the issue, is the same as what the bot found, just in a different location. The binary dotnet test protocol is reporting the runtime framework rather than the framework of the assembly.

(unlike .NET Core, only 1 installation of .NET Framework can be on the system, so it makes a difference).

https://github.com/microsoft/testfx/blob/main/src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs#L98C75-L98C95

Here the effective runtime is reported, rather than the desired version as specified by TargetFramework attribute on the tested proram/assembly.

nohwnd avatar Dec 08 '25 11:12 nohwnd