我在ASP.NET Core(v2)Web Api项目中使用BitcoinLib。但是,每当我尝试实例化服务时:
let textFont = UIFont.boldSystemFont(ofSize: )
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center
paragraphStyle.minimumLineHeight = rectangle.height / 2 + textFont.lineHeight / 2
let textAttributes = [
NSAttributedStringKey.font: textFont,
NSAttributedStringKey.paragraphStyle: paragraphStyle
] as [NSAttributedStringKey : Any]
let text = "Text"
(text as NSString).draw(in: rectangle, withAttributes: textAttributes)
我收到错误:
在配置文件中找不到CoinParameters中定义的一个或多个必需参数!
我验证了传入的值不是空的正确的,我甚至已将设置添加到 var bitcoinService = new BitcoinLib.Services.Coins.Bitcoin
.BitcoinService(appSettings.BitcoinSettings.ServerUrl,
appSettings.BitcoinSettings.Username,
appSettings.BitcoinSettings.Password,
appSettings.BitcoinSettings.WalletPassword);
:
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>
...
支票或者我在这里做错了什么?
答案 0 :(得分:0)
显示的例外是误导......实际问题是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