Robert Dannelly blog, Over the internet you can find me by "robert dannelly blog". The blog is an ongoing blog of my software engineering over technologies C#, VB.NET, Java, React, JavaScript, .NET Core Current, SQL Server 7 - Current Version, GIT, GitHub, Jira, Azure, AWS and HTML5. “I have not failed. I've just found 10,000 ways that won't work.” Thomas A. Edison, please click on all links to help support this blog. Thank you. “As an Amazon Associate, I earn from qualifying purchases.”
Tuesday, October 02, 2018
.NET Core 500 Exception how to see your errors
If you are developing using .Net Core be sure to set the final Configure to the following and be sure to use your keyboard short cut alt+enter to bring in the missing using namespaces for
your references needed.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
env.EnvironmentName = EnvironmentName.Development;
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/error");
}
app.UseStatusCodePages();
// Enable middleware to serve generated Swagger as a JSON endpoint.
app.UseSwagger();
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
// specifying the Swagger JSON endpoint.
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
c.RoutePrefix = string.Empty;
});
app.UseMvc();
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment