asp.net核心3 rotativa startup.cs env问题

编程入门 行业动态 更新时间:2024-10-25 15:20:05
本文介绍了asp核心3 rotativa startup.cs env问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试使用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问题

本文发布于:2023-11-14 14:01:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587407.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:核心   net   asp   rotativa   env

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!