在.NetCore软件包中使用NToastNotify软件包会引起以下故障

问题描述

有人在任何.Net Core项目中使用NToastNotify软件包吗?这是我的描述性问题。我遵循了此处列出的说明(对于Noty,请阅读已记录的Noty说明)-https://github.com/nabinked/NToastNotify

我得到的错误-

找不到类型或名称空间名称'IToastNotification' (您是否缺少using指令或程序集引用?)

找不到类型或名称空间名称“ NToastNotify”(您是 缺少using指令或程序集引用?)

在试图实施该软件包的有关空间中。

例如,在控制器中

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中。麻烦吗?版本冲突?指针,从哪里开始进行纠正。

解决方法

值得一提的是,项目位于.Net Core 2.2中。可能是 麻烦?版本冲突?指针,从哪里开始纠正 这个。

是的,这是版本冲突。

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

要在当前项目中解决该问题,需要下载NToastNotify package,其版本应为lower than 6.0.1,这意味着您只能下载软件包up to version 5.0.12以适应{{1} }。

enter image description here