Telerik报告.NET 5演练会产生错误“ ConfigurationHelper在当前上下文中”
在.net 5'步行在这里在早期,他们会让您粘贴以下内容:
// Configure dependencies for ReportsController.
services.TryAddSingleton<IReportServiceConfiguration>(sp =>
new ReportServiceConfiguration
{
ReportingEngineConfiguration = ConfigurationHelper.ResolveConfiguration(sp.GetService<IWebHostEnvironment>()),
HostAppId = "Net5RestServiceWithCors",
Storage = new FileStorage(),
ReportSourceResolver = new UriReportSourceResolver(
System.IO.Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"))
});
但是 configurationHelper 被标记为“当前上下文中不存在”。
我知道我可能需要参考一个程序集,但我确实通过Nuget Telerik.Reporting.Services.aspnetcore.trial添加了所有所需的依赖项。
因此,我不知道我需要哪种组件才能获得配置求职者。
我怀疑这是一个非常愚蠢的问题,因为互联网上几乎没有关于ConfigurationHelper的问题,这意味着答案是如此简单的人甚至不需要谷歌搜索。
那么,我需要使用nuget telerik.reporting.services.aspnetcore.berial添加到全新的ASP.NET Core Web Application 5.0中,以解决configurationHelper?
Following the 'How to Host Reports Service in ASP.NET Core in .NET 5' walk through here and early on they have you paste the following in ConfigureSerivces:
// Configure dependencies for ReportsController.
services.TryAddSingleton<IReportServiceConfiguration>(sp =>
new ReportServiceConfiguration
{
ReportingEngineConfiguration = ConfigurationHelper.ResolveConfiguration(sp.GetService<IWebHostEnvironment>()),
HostAppId = "Net5RestServiceWithCors",
Storage = new FileStorage(),
ReportSourceResolver = new UriReportSourceResolver(
System.IO.Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"))
});
However ConfigurationHelper is flagged as 'does not exist in current context'.
I know I probably need to reference an assembly but I did add all the supposed required dependencies via nuget Telerik.Reporting.Services.AspNetCore.Trial.
So I don't know what assembly I need to get ConfigurationHelper.
I suspect this is a really stupid question because there is virtually nothing on the internet about ConfigurationHelper which means the answer is so simple people don't even need to google it.
So what do I need to add to a brand new ASP.NET Core Web Application 5.0 with nuget Telerik.Reporting.Services.AspNetCore.Trial in order to resolve ConfigurationHelper?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
configurationHelper 只是项目中的静态类,如果需要,可以重命名,然后在此行中使用
reportingingingingingingingingingingingingingingingingegineconfiguration = ConfigurationHelper.ResolveconFiguration(Sp.GetService&getService&getService&lt; iwebhostenvironment&gt&gt&gt&gt&gt&gt;()
从您发布的文章中获取:
您可以查看安装中的演示项目,该路径应类似于c:\ program文件(x86)\ progress \ progress \ telerik报告R2 2022 \ ackames \ ackames \ csharp .NET 5 \ ReportingRestServiceCorsDemo
ConfigurationHelper is just a static class in your project, you can rename it if you want, then use it in this line
ReportingEngineConfiguration = ConfigurationHelper.ResolveConfiguration(sp.GetService<IWebHostEnvironment>()),
Taken from the article you have posted:
You can have a look at the demo projects in your installation, the path should be similar to C:\Program Files (x86)\Progress\Telerik Reporting R2 2022\Examples\CSharp.NET 5\ReportingRestServiceCorsDemo