title: Find out PlatformNotSupportedException during build
body: <p>I am developing a project for <code>Windows</code> using <code>.NET Core 2.2</code>. I'm going to build and support it on <code>Linux</code> next year. I am looking for a way to flag up an error and break the build if <code>PlatformNotSupportedException</code> is used in code.</p>
  
  <p>I've seen the <a href="https://docs.microsoft.com/en-us/dotnet/standard/analyzers/api-analyzer" rel="nofollow noreferrer">.NET API analyzer</a> which is still in pre-release phase and not updated since last year.</p>