2

I am running unit tests on a .NET project against a specific version of .NET framework and I am using following command:

dotnet test --framework v4.7.2

But when running this, I am getting following error:

/usr/local/share/dotnet/sdk/6.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(92,5): error NETSDK1013: The TargetFramework value 'v4.7.2' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.

Is there anything that I need to change?

StandardProc
  • 85
  • 1
  • 8
  • 1
    Have you tried `net472`? I think, a TFM (target framework moniker) must be used here. – Christian.K Aug 08 '22 at 05:19
  • You need to use the correct Target Framework Moniker (TFM), in this case `net472`. All supported TFMs are documented [here](https://learn.microsoft.com/en-us/dotnet/standard/frameworks) – MindSwipe Aug 08 '22 at 05:40

0 Answers0