Sto provando a impostare un doc di base swagger API in un nuovo progetto ASP .net CORE/MVC 6 e a ricevere un errore 500 dall'interfaccia utente swagger: 500 : http://localhost:4405/swagger/v1/swagger.json
Errore 500 durante l'impostazione di Swagger nell'app. CORE/MVC 6 asp
la mia classe di avvio ha il seguente codice in esso:
using Swashbuckle.SwaggerGen;
using Swashbuckle.SwaggerGen.XmlComments;
using Swashbuckle.Application;
....
public void ConfigureServices(IServiceCollection services)
{
...
services.AddSwaggerGen();
services.ConfigureSwaggerDocument(options =>
{
options.SingleApiVersion(new Info
{
Version = "v1",
Title = "Blog Test Api",
Description = "A test API for this blogpost"
});
});
}
e poi in Configura:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
....
app.UseSwaggerGen();
app.UseSwaggerUi();
....
}
quando costruire ed eseguire il progetto, l'interfaccia utente verrà fuori quando vado a swagger/UI/index.html, ma viene visualizzato l'errore 500 sopra. Quando vado al/v1/link swagger.json spavalderia, console dà il 500 errore seguente: Failed to load resource: the server responded with a status of 500 (Internal Server Error)
C'è un modo riesco a capire la causa principale del 500 o permettere a qualsiasi supplementari di debug in spavalderia di figura perché sta generando questo errore? Sulla base di alcune delle esercitazioni che ho esaminato, è necessario solo ciò che ho in avvio per un'implementazione di base. Per favore fatemi sapere se posso fornire ulteriori informazioni.
EDIT: questo è per RC1, e non può essere rilevante per il nuovo netcore 1,0 attualmente fuori (6/29/2016)
Confermo questa correzione. – mabead
Ha funzionato anche per me. –
Ha funzionato anche per me. –