0

I am trying to install SwashBuckle to an ASP.NET 5 Web API application.

The problem comes during installation where I get the following error:

enter image description here

This is due to the fact that the package is only partly compatible with DNX Core 5, specifically WebActivatorEx which is installed under DNX 4.5.1 and as such the SwashBuckle dll can't get at it as that is installed under DNX Core 5.

Following this answer, I moved both dlls under DNX 4.5.1 as suggested:

enter image description here

This has meant that the solution now builds, however I don't see any of the config add to StartUp.cs to enable and register Swagger. I have been trying to piece this together from examples for ASP.NET 4.5.1 but to no avail.

All I am currently seeing when I browse to http://MyApi/Swagger is a blank screen.

Can anybody let me know how I can register swagger with my API correctly?

Community
  • 1
  • 1
Declan McNulty
  • 3,194
  • 6
  • 35
  • 54
  • Since WebActivatorEx isn't compatible with .NET Core, you can only use it when compiling for the full .NET Framework. – mason Mar 03 '16 at 15:31

1 Answers1

0

Just Add

Blockquote

"Swashbuckle": "6.0.0-beta9"

Blockquote

To your Dependencies in the project.json file. Save the Project.json file and let the NPM Restore do its thing. Not sure why the other lower Stable builds don't work but this one does.

Joe Ricklefs
  • 584
  • 4
  • 24