【问题标题】:Portable class library for referred nuget packages dll not generated未生成引用的 nuget 包 dll 的可移植类库
【发布时间】:2017-01-19 08:33:34
【问题描述】:

我创建了一个 .net 标准 1.3 PCL 并使用 Visual Studio 2015 在该库中引用了 newtonsoft.json 包。

之后我尝试将此 dll 引用到 .net framework 4.5.2 的控制台应用程序,在执行控制台应用程序时,我收到一个错误

Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

我看到在构建项目的 PCL 中我没有得到依赖包的 dll,为什么会存在这个问题? 如何解决这个问题?

注意 - 控制台应用程序和 PCL 库的构建位置相同。

【问题讨论】:

  • 你不应该尝试在 VS2015 中创建任何 .NET Standard 的东西。请改用 VS2017。

标签: c# portable-class-library .net-standard


【解决方案1】:

我在探索中发现的最佳方法是使用 dotnet pack 创建 nuget 包并在项目中引用它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-18
    • 2016-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-02
    • 1970-01-01
    相关资源
    最近更新 更多