WebApi's {“message”:“an error has occurred”} on IIS7, not in IIS Express

后端 未结 9 1954
滥情空心
滥情空心 2020-12-12 10:36

I\'m working with ASP.NET MVC 4 WebApi and am having a lot of fun with it running it on my local computer on IIS Express. I\'ve configured IIS Express to serve remote machi

9条回答
  •  萌比男神i
    2020-12-12 11:09

    My swagger XML file was not deployed into \bin:

    GlobalConfiguration.Configuration
      .EnableSwagger(c =>
      {
        c.SingleApiVersion("v1", "SwaggerDemoApi");
        c.IncludeXmlComments(string.Format(@"{0}\bin\SwaggerDemoApi.XML", 
                             System.AppDomain.CurrentDomain.BaseDirectory));
        c.DescribeAllEnumsAsStrings();
      })
    

    http://wmpratt.com/swagger-and-asp-net-web-api-part-1/

    It had to be set in the Release Configuration as well as in the Debug Configuration.

提交回复
热议问题