【发布时间】:2018-01-28 15:12:56
【问题描述】:
我正在尝试在我的应用程序中使用库,我对此有点陌生,我正在遵循此说明, https://docs.microsoft.com/en-us/dotnet/core/tutorials/consuming-library-with-visual-studio?tabs=csharp
基本上我已经打开了库解决方案并向其中添加了一个新项目, 但是,当我运行时,出现以下错误:
项目“..\src\gdax.netcore.csproj”以“netstandard1.6”为目标。它不能被以 '.NETFramework,Version=v4.5' 为目标的项目引用。 GdApp1
我不确定如何解决这个问题,我尝试在库和项目中更改各种目标版本,如果我将项目目标设置为 4.6.1,我会丢失与我正在使用的图书馆。
我正在尝试使用这个库https://github.com/sefbkn/gdax.netcore 在这一点上,我的代码基本上是他们示例的直接副本
缺少的参考资料和错误是:
The type or namespace name 'RequestAuthenticator' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'ProductClient' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'gdax' could not be found (are you missing a using directive or an assembly reference?)
The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
【问题讨论】:
-
对,我确实看过,所以 .netstandard 1.6 应该与 4.6.1 框架兼容吧?当我更改为那个时,我怎么会丢失参考?
-
您能否更详细地解释缺少的参考资料?您要使用什么库以及使用什么代码来调用它?发布代码将帮助我们帮助您。
-
非常感谢您的帮助 Lesscode,我已经更新了主帖
-
你是如何引用这个库的?我没有看到它的 Nuget 包,所以您只是将项目代码添加到您的解决方案中吗?确保您的源代码中有正确的
using Boukenken.Gdax;声明。
标签: c# .net .net-standard