我尝试使用Rotativaım,请遵循此指南在配置功能ım的start.cs中添加此代码
Im try to use Rotativa ım follow this guide in start.cs in configure function ım add this code
RotativaConfiguration.Setup(env); Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'ım搜索此错误并找到此错误,然后像这样转换我的代码
ım search this error and find this and convert my code like this
RotativaConfiguration.Setup(env.WebRootPath, "Rotativa");及其给我这个错误
Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot convert from 'string' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'ım在wwwroot中添加Rotative文件夹并添加wkhtmltoimage.exe,wkhtmltopdf.exe
ım add Rotative folder in wwwroot and added wkhtmltoimage.exe, wkhtmltopdf.exe
我的软件包版本Rotativa.aspnetcore v1.1.1ım使用当前的asp核心版本3.xx谁能解释我什么问题?
my package version Rotativa.aspnetcore v1.1.1 ım using current asp core version 3.xx what is problem any one can be explain me ?
推荐答案我在statup.cs中的configure函数add env2和obsolute中找到了这样的解决方案
Im find a solution like this in statup.cs in configure function add env2 and obsolute
[Obsolete] public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Microsoft.AspNetCore.Hosting.IHostingEnvironment env2)并像这样更改
RotativaConfiguration.Setup(env2);它现在可以工作,但是如果您更好地描述了它,那将是一个不好的解决方案.
its working now but ıts bad solution if you know better one pls describe it.
// Rotary configuration // This is for the rotating to use the files in the Rotating folder RotativaConfiguration.Setup (env.ContentRootPath, "Rotativa");更多推荐
asp.net核心3 rotativa startup.cs env问题
发布评论