แก้ปัญหา swagger สร้าง page Error เมื่อใช้งาน WebREportDesigner
**** ยังไม่ได้ เลยเอาออกจากระบบไปก่อน *****
This commit is contained in:
parent
9b3efd8981
commit
ec3395d970
7 changed files with 52 additions and 55 deletions
|
|
@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.AspNetCore.Mvc.Versioning;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Serilog;
|
||||
|
|
@ -16,9 +15,6 @@ using Serilog.Exceptions;
|
|||
using Serilog.Sinks.Elasticsearch;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Telerik.Reporting.Cache.File;
|
||||
using Telerik.Reporting.Services;
|
||||
using Telerik.WebReportDesigner.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
{
|
||||
|
|
@ -92,28 +88,16 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
})
|
||||
.AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
||||
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.IgnoreObsoleteActions();
|
||||
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
|
||||
});
|
||||
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
|
||||
|
||||
builder.Services.AddHealthChecks();
|
||||
|
||||
// For Telerik Report Designer
|
||||
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp =>
|
||||
new ReportServiceConfiguration
|
||||
{
|
||||
ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(sp.GetService<IWebHostEnvironment>()),
|
||||
HostAppId = "ReportingCoreApp",
|
||||
Storage = new FileStorage(),
|
||||
ReportSourceResolver = new TypeReportSourceResolver().AddFallbackResolver
|
||||
(new UriReportSourceResolver(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports")))
|
||||
});
|
||||
builder.Services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
|
||||
{
|
||||
DefinitionStorage = new FileDefinitionStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"), new[] { "Resources", "Shared Data Sources" }),
|
||||
ResourceStorage = new ResourceStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports", "Resources")),
|
||||
SharedDataSourceStorage = new FileSharedDataSourceStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports", "Shared Data Sources")),
|
||||
SettingsStorage = new FileSettingsStorage(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting"))
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue