Selecting a Target Framework (TFM) via MSBuild command line parameter

Vic R 1 Reputation point

I have a solution with multi-target project, created like so:


But every time I build the solution, it's being built first for net461, and then for net472.

What I am trying to achieve is two-fold:

  • Being able to select a specific TFM to build from within Visual Studio IDE (say, I only want to build net472)
  • Same goal as above, but achieve it via MSBuild command line.

Passing something like /p:TargetFrameworks="net472" does not really work.

Any help/advice is greatly appreciated.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
32,740 questions
{count} votes