title: Can't read swagger JSON file on ASP.NET Core 1.2 Application after hosting into local IIS
body: <p>After hosting my asp.net core 1.2 application, I am getting an error as:</p>
  
  <blockquote>
    <p>swagger is unable to find the <code>swagger.json</code> file.</p>
  </blockquote>
  
  <p>I have tried to solve the problem by giving a virtual path name <code>app.UseSwaggerUI()</code> but it's not working.</p>
  
  <p><strong>Edit to clarify question based on comments:</strong></p>
  
  <p>After hosting Asp.net core application in IIS, the <code>swagger.json</code> file is generating on <code>localhost:&lt;random_port&gt;/swagger/v1/swagger.json</code> path.</p>
  
  <p>How do I serve the <code>swagger.json</code> file on a custom route like:
  <code>localhost:&lt;random_port&gt;/virtualpathname/swagger/v1/swagger.json</code> </p>
  
  <p>I have tried to set a virtual path in app.UseSwaggerUI() like <code>{virtualpathname}/swagger/v2/swagger.json</code> but still it is not working</p>