每当我尝试安装某个 Discord 包时,都会弹出依赖注入错误
Dependency injection error pops up whenever I try to install a certain Discord Package
我真的是编程新手,但我想为我的 discord 服务器尝试一些机器人开发,比如当人们加入时偶尔会向他们打招呼,但是当我尝试安装其中一个时Discord 包我收到这个错误
Unable to resolve dependency 'Microsoft.Extensions.DependencyInjection'. Source(s) used: 'discord.net', 'Microsoft Visual Studio Offline Packages'.
Unable to resolve dependency
'Microsoft.Extensions.DependencyInjection'. Source(s) used:
'discord.net', 'Microsoft Visual Studio Offline Packages'.
当你要安装没有找到依赖包的包时,总会出现这个错误信息。例如,我创建了一个依赖于 Microsoft.Extensions.DependencyInjection
.
的自定义包 (MyCustomPKG
)
如果 nuget 在所有可用的包源中找不到 Microsoft.Extensions.DependencyInjection
,我会遇到同样的问题。
To resolve that issue:
添加 nuget.org
(https://api.nuget.org/v3/index.json) as package sources 并确保复选框已启用。
另外: 如果你没有使用 VS IDE,而是使用 Nuget.exe
+Nuget.config
文件,添加这一行(<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
)到Nuget.config
.
我真的是编程新手,但我想为我的 discord 服务器尝试一些机器人开发,比如当人们加入时偶尔会向他们打招呼,但是当我尝试安装其中一个时Discord 包我收到这个错误
Unable to resolve dependency 'Microsoft.Extensions.DependencyInjection'. Source(s) used: 'discord.net', 'Microsoft Visual Studio Offline Packages'.
Unable to resolve dependency 'Microsoft.Extensions.DependencyInjection'. Source(s) used: 'discord.net', 'Microsoft Visual Studio Offline Packages'.
当你要安装没有找到依赖包的包时,总会出现这个错误信息。例如,我创建了一个依赖于 Microsoft.Extensions.DependencyInjection
.
MyCustomPKG
)
如果 nuget 在所有可用的包源中找不到 Microsoft.Extensions.DependencyInjection
,我会遇到同样的问题。
To resolve that issue:
添加 nuget.org
(https://api.nuget.org/v3/index.json) as package sources 并确保复选框已启用。
另外: 如果你没有使用 VS IDE,而是使用 Nuget.exe
+Nuget.config
文件,添加这一行(<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
)到Nuget.config
.