获取 BitcoinLib 错误 = "One or more required parameters, as defined in CoinParameters, were not found in the configuration file!"
Getting BitcoinLib Error = "One or more required parameters, as defined in CoinParameters, were not found in the configuration file!"
我在我的 ASP.NET 核心 (v2) Web Api 项目中使用 BitcoinLib。但是,每当我尝试实例化服务时:
var bitcoinService = new BitcoinLib.Services.Coins.Bitcoin
.BitcoinService(appSettings.BitcoinSettings.ServerUrl,
appSettings.BitcoinSettings.Username,
appSettings.BitcoinSettings.Password,
appSettings.BitcoinSettings.WalletPassword);
我收到错误:
One or more required parameters, as defined in CoinParameters, were not found in the configuration file!
我验证了传入的值不为空且正确,我什至将设置添加到我的 web.config
:
<configuration>
<appSettings>
<add key="RpcRequestTimeoutInSeconds" value="60" />
<add key="Bitcoin_DaemonUrl" value="http://localhost:18332" />
<add key="Bitcoin_DaemonUrl_Testnet" value="http://localhost:18332" />
<add key="Bitcoin_WalletPassword" value="X" />
<add key="Bitcoin_RpcUsername" value="X" />
<add key="Bitcoin_RpcPassword" value="X" />
</appSettings>
...
没有任何效果...我需要分叉这个东西并删除那个 IgnoreConfigFiles
检查还是我在这里做错了什么?
显示的异常是误导...实际问题出在 rpcRequestTimeoutInSeconds
。该库需要像这样重载:
BitcoinService(string daemonUrl, string rpcUsername, string rpcPassword, string walletPassword, short rpcRequestTimeoutInSeconds)
好像NuGet
包不见了?正如我在代码中看到的那样...
更多信息在这里:
https://github.com/GeorgeKimionis/BitcoinLib/issues/42
我确实在这里创建了一个 .NET Core
兼容的:
https://github.com/SaganMarketing/BitcoinLib
您可以在这里获取包裹:
https://www.myget.org/feed/saganmarketing/package/nuget/BitcoinLib
我在我的 ASP.NET 核心 (v2) Web Api 项目中使用 BitcoinLib。但是,每当我尝试实例化服务时:
var bitcoinService = new BitcoinLib.Services.Coins.Bitcoin
.BitcoinService(appSettings.BitcoinSettings.ServerUrl,
appSettings.BitcoinSettings.Username,
appSettings.BitcoinSettings.Password,
appSettings.BitcoinSettings.WalletPassword);
我收到错误:
One or more required parameters, as defined in CoinParameters, were not found in the configuration file!
我验证了传入的值不为空且正确,我什至将设置添加到我的 web.config
:
<configuration>
<appSettings>
<add key="RpcRequestTimeoutInSeconds" value="60" />
<add key="Bitcoin_DaemonUrl" value="http://localhost:18332" />
<add key="Bitcoin_DaemonUrl_Testnet" value="http://localhost:18332" />
<add key="Bitcoin_WalletPassword" value="X" />
<add key="Bitcoin_RpcUsername" value="X" />
<add key="Bitcoin_RpcPassword" value="X" />
</appSettings>
...
没有任何效果...我需要分叉这个东西并删除那个 IgnoreConfigFiles
检查还是我在这里做错了什么?
显示的异常是误导...实际问题出在 rpcRequestTimeoutInSeconds
。该库需要像这样重载:
BitcoinService(string daemonUrl, string rpcUsername, string rpcPassword, string walletPassword, short rpcRequestTimeoutInSeconds)
好像NuGet
包不见了?正如我在代码中看到的那样...
更多信息在这里: https://github.com/GeorgeKimionis/BitcoinLib/issues/42
我确实在这里创建了一个 .NET Core
兼容的:
https://github.com/SaganMarketing/BitcoinLib
您可以在这里获取包裹: https://www.myget.org/feed/saganmarketing/package/nuget/BitcoinLib