title: Could not load file or assembly 'Microsoft.OpenApi'... while using Swashbuckle.AspNetCore.Cli
body: <p>I'm getting the subject error message while using the sample MS PowerShell script from the article <a href="https://www.patriksvensson.se/2018/10/generating-api-clients-using-autorest" rel="nofollow noreferrer">Generating API clients using AutoRest</a> when the following command line</p>
  
  <pre><code>dotnet swagger "tofile" --output "../../res/swagger.json" "../Sample.Api/bin/Debug/netcoreapp2.1/Sample.Api.dll" v1
  </code></pre>
  
  <p>is executed. Solution?</p>
  
  <p>FYI: Swashbuckle.AspNetCore.Cli entry source code is located here: <a href="https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.Cli/Program.cs" rel="nofollow noreferrer">Swashbuckle.AspNetCore/src/Swashbuckle.AspNetCore.Cli/Program.cs</a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I should have posted the full text of runtime error message - here it is:</p>
  
  <pre><code>At C:\Tests\Swashbuckle\build.ps1:8 char:1
  + dotnet swagger "tofile" --output "../../res/swagger.json" "../Sample. ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : NotSpecified: (:String) [], RemoteException
  + FullyQualifiedErrorId : NativeCommandError
  
  Unhandled Exception:
  
  System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.OpenApi, 
       Version=1.1.1.0, Culture=neutral, PublicKeyToken=3f5743946376f042'. 
       The system cannot find the file specified.
  at Swashbuckle.AspNetCore.Cli.Program.&lt;&gt;c.&lt;Main&gt;b__0_3(IDictionary`2 namedArgs)
  at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args)
  at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args)
  at Swashbuckle.AspNetCore.Cli.Program.Main(String[] args)
  </code></pre>