4

I've been looking at different options for providing auto generated API Documentation and Swagger seems to be up there.

However when trying this out for the first time I'm getting exceptions on start up.

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

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

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.

Does anyone else know of a step we are missing? We found & followed this:
https://github.com/Swagger-Net/Swagger.Net/wiki
https://github.com/Swagger-Net/Swagger.Net/blob/master/README.md

3 Answers 3

4

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

Sign up to request clarification or add additional context in comments.

2 Comments

Steven: Did you try modifying the source code to work with swagger and succeed.? If yes, could you share the way to do it. Thanks
Yeah, just get out the source code. Open the project and go into project properties. Set the framework to be 4.5. I cannot remember if there was any other modifications i did but i think it was as simple as that. Just compile it for 4.5 and ready to go.
1

I have made a library for use with mvc that generates the documentation for you based on attributes. It may be what your looking for.

There is dcoumentation in the repository on github just click the project site link. Hope this helps

Comments

1

Try using Swashbuckle.

Based on Swagger as far as I know and it worked first time for me...

https://github.com/domaindrivendev/Swashbuckle

1 Comment

Please don't post identical answers to multiple questions. Post one good answer, then vote/flag to close the other questions as duplicates. If the question is not a duplicate, tailor your answers to the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.