在 .NetCore 包中使用 NToastNotify 包会引发以下故障

usage of NToastNotify package in .NetCore package raises the following glitch

有人在任何 .Net Core 项目中使用过 NToastNotify 包吗?这是我提出的一个描述性问题。我按照此处列出的说明进行操作(对于 Noty,请阅读 Noty 的文档说明)- https://github.com/nabinked/NToastNotify

我得到的错误 -

The type or namespace name 'IToastNotification' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'NToastNotify' could not be found (are you missing a using directive or an assembly reference?)

在尝试实施包的相关空间中。

例如在控制器中

private readonly IToastNotification _toastNotification;

public AccountsController(UserManager<AppUser> userManager, IToastNotification toastNotification, SignInManager<AppUser> signInM, ILogger<AccountsController> logger, ApplicationDbContext appDbContext)
{
    _logger = logger;
    _signInManager = signInM;
    _userManager = userManager;
    _appDbContext = appDbContext;
    _toastNotification = toastNotification;
}

知道可能是什么问题吗?我也与 CodeGeneration.Design 包发生冲突。于是卸载重装。是否对项目进行了清理和重建。这似乎没有解决问题。

值得一提的是,项目在 .Net Core 2.2 中。那会是麻烦吗?版本冲突?指点一下,从哪里入手改正。

Worth mentioning, project is in .Net Core 2.2. Could that be the trouble? Version conflict? Pointers, where to start from to rectify this.

是的,这是版本冲突。

如果您使用.net core 3.0以上版本,可以安装最新版本的NToastNotify包。

在你当前的项目中解决,你需要下载NToastNotify package版本应该是lower than 6.0.1,也就是说你只能下载包up to version 5.0.12来适配.net core 2.2.