Я пытаюсь добавить инструмент отчетов Telerik в свой проект вручную. Но ошибка ниже.
{
"message": "An error has occurred.",
"exceptionMessage": "Method not found: 'Void Microsoft.AspNetCore.Mvc.JsonResult..ctor(System.Object, Newtonsoft.Json.JsonSerializerSettings)'.",
"exceptionType": "MissingMethodException",
"stackTrace": null
}
The Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddNewtonsoftJson();
builder.Services.AddControllersWithViews();
builder.Services.TryAddScoped();
builder.Services.TryAddSingleton(sp =>
new ReportServiceConfiguration
{
ReportingEngineConfiguration = sp.GetService(),
HostAppId = "ReportingNet6",
Storage = new FileStorage(),
ReportSourceResolver = new TypeReportSourceResolver()
.AddFallbackResolver(new UriReportSourceResolver(
System.IO.Path.Combine(sp.GetService().ContentRootPath, "Reports"))
.AddFallbackResolver(new CustomReportSourceResolver()))
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
Контроллер отчетов
[Route("api/reports")]
public class ReportsController : ReportsControllerBase
{
public ReportsController(IReportServiceConfiguration reportServiceConfiguration)
: base(reportServiceConfiguration)
{
}
}
Вид
@{
ViewData["Title"] = "Home Page";
}
loading...
@section Scripts
{
$(document).ready(function () {
$("#reportViewer1").telerik_ReportViewer({
serviceUrl: "/api/reports/",
reportSource: {
report: "Product Sales.trdp",
parameters: {
CultureID: "en"
}
}
});
});
}
Подробнее здесь: https://stackoverflow.com/questions/769 ... -with-net6
Возникает ошибка, когда телерик сообщает Html5 с помощью net6 ⇐ C#
Место общения программистов C#
-
Anonymous
1731624681
Anonymous
Я пытаюсь добавить инструмент отчетов Telerik в свой проект вручную. Но ошибка ниже.
{
"message": "An error has occurred.",
"exceptionMessage": "Method not found: 'Void Microsoft.AspNetCore.Mvc.JsonResult..ctor(System.Object, Newtonsoft.Json.JsonSerializerSettings)'.",
"exceptionType": "MissingMethodException",
"stackTrace": null
}
The Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddNewtonsoftJson();
builder.Services.AddControllersWithViews();
builder.Services.TryAddScoped();
builder.Services.TryAddSingleton(sp =>
new ReportServiceConfiguration
{
ReportingEngineConfiguration = sp.GetService(),
HostAppId = "ReportingNet6",
Storage = new FileStorage(),
ReportSourceResolver = new TypeReportSourceResolver()
.AddFallbackResolver(new UriReportSourceResolver(
System.IO.Path.Combine(sp.GetService().ContentRootPath, "Reports"))
.AddFallbackResolver(new CustomReportSourceResolver()))
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
Контроллер отчетов
[Route("api/reports")]
public class ReportsController : ReportsControllerBase
{
public ReportsController(IReportServiceConfiguration reportServiceConfiguration)
: base(reportServiceConfiguration)
{
}
}
Вид
@{
ViewData["Title"] = "Home Page";
}
loading...
@section Scripts
{
$(document).ready(function () {
$("#reportViewer1").telerik_ReportViewer({
serviceUrl: "/api/reports/",
reportSource: {
report: "Product Sales.trdp",
parameters: {
CultureID: "en"
}
}
});
});
}
Подробнее здесь: [url]https://stackoverflow.com/questions/76953236/error-happening-telerik-reporting-html5-with-net6[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия