Skip to content

Detecting platform using IsOSPlatform() doesn't work in a Docker linux container #8777

Discussion options

You must be logged in to vote

Condition="$([MSBuild]::IsOSPlatform('Windows'))" -- AFAIK this checks the platform on which you run MSBuild. So if you build on Windows but run on Linux, it won't match.

How do you set the target frameworks; do you have net6.0-windows there?

I'm surprised you get a TypeInitializerException. Which version of the System.Diagnostics.PerformanceCounter package are you using, and what is the inner exception?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GangWang01
Comment options

Answer selected by GangWang01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants