Swagger.NET MVC阿比异常 [英] Swagger.NET MVC Api Exception

查看:5520
本文介绍了Swagger.NET MVC阿比异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在寻找不同的选项提供自动生成的API文档和扬鞭似乎是在那里。

Been looking at different options for providing auto generated API Documentation and Swagger seems to be up there.

然而,当了。

运行Visual Studio 2013年的结果
创建新的Web API项目。结果
使用软件包管理器,运行:

Running Visual Studio 2013.
Create new Web API project.
Using Package Manager, run:

Install-Package Swagger.Net & Install-Packager Swagger.Net.UI

确保我们已经启用XML文档,我们得到这个异​​常:

Making sure we've enable the XML documentation we get this exception:

Method 'GetDocumentation' in type 'Swagger.Net.XmlCommentDocumentationProvider' 
from assembly 'Swagger.Net, Version=0.5.1.0, Culture=neutral, PublicKeyToken=null' 
does not have an implementation.

我们是否缺少的一个步骤谁都知道吗?我们发现:放;遵循这个:结果
https://github.com/Swagger-Net/Swagger.Net/wiki 结果
https://github.com/Swagger-Net/Swagger.Net /blob/master/README.md

推荐答案

扬鞭不支持.NET 4.5 - 必须从混帐获得源$ C ​​$ C并修改它与4.5的工作。

Swagger doesn't support .NET 4.5 - Had to get the source code out from git and modify it to work with 4.5.

右键单击项目,并在那里设置目标框架

Right click the project and set the target framework in there

这篇关于Swagger.NET MVC阿比异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆