.net core 招摇过市文档覆盖/md覆盖加载器-失败

.net core 招摇过市文档覆盖/md覆盖加载器-失败,.net-core,swashbuckle,autorest,.net Core,Swashbuckle,Autorest,当我在运行IIS的服务器2012R2上托管api时,我能够使用Autorest生成代码 但是,当我尝试使用localhost url运行它时,我收到一条无法读取的消息 我可以在浏览器中读取swagger.json 我正在使用命令 autorest --input-file=https://localhost:44348/api-docs/v1/swagger.json --output-folder=generated --csharp --namespace=DD.MyApp.Connecto

当我在运行IIS的服务器2012R2上托管api时,我能够使用Autorest生成代码

但是,当我尝试使用localhost url运行它时,我收到一条无法读取的消息

我可以在浏览器中读取swagger.json

我正在使用命令

autorest --input-file=https://localhost:44348/api-docs/v1/swagger.json
--output-folder=generated --csharp --namespace=DD.MyApp.Connector
输出是

AutoRest code generation utility [version: 2.0.4283; node: v10.11.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      'C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4289\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4289)
   Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.82)
   Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55->2.3.55)
FATAL: swagger-document-override/md-override-loader - FAILED
FATAL: Error: Could not read 'https://localhost:44348/api-docs/v1/swagger.json'.
FATAL: swagger-document/loader - FAILED
FATAL: Error: Could not read 'https://localhost:44348/api-docs/v1/swagger.json'.
Process() cancelled due to exception : Could not read 'https://localhost:44348/api-docs/v1/swagger.json'.
  Error: Could not read 'https://localhost:44348/api-docs/v1/swagger.json'.
学习之后,我尝试使用dotnet运行启动api 但这没有帮助

我试着用管理员权限在dos命令shell中运行autorest

根据github问题,我可以将swagger.json保存到一个文件中,并通过引用该文件生成代码


这不是一个很好的解决方案

您是否试图将
https
localhost
一起使用?如果您没有在上面放置证书,则不应该使用
https


http://localhost

我不再遇到此问题。我想知道它是否与Visual Studio版本有关。它与https配合良好(正如我所说,它现在正在工作)。我已在解决方案的“调试”选项卡中选中了启用SSL。