【问题标题】:dotnet restore fail "Unable to resolve 'PCLLibrary' for '.NETCoreApp,Version=v1.0'."dotnet restore 失败“无法解析 '.NETCoreApp,Version=v1.0' 的 'PCLLibrary'。”
【发布时间】:2016-11-24 21:50:25
【问题描述】:

我在 .NET CORE 1.0 项目中使用了 PCL 项目('PCLLibrary') Visual Studion 一切正常, 当我尝试从命令行执行 dotnet restore 时,bu 失败。 我需要它在 teamcity 上构建它。

D:\WebExternal\WebExternal\src\Web\project.json 中的错误 无法解析“.NETCoreApp,Version=v1.0”的“PCLLibrary”。

我试图用谷歌搜索它,但没有找到任何有用的结果。 请帮我。

Here you can get the project

要测试从文件夹执行命令“dotnet restore”, 其中包含 project.json

【问题讨论】:

  • 你能把你的代码放在某个地方吗?以便有人可以调查它。
  • 我将项目添加到问题正文中

标签: c# .net asp.net-core


【解决方案1】:

将你的 PCLLibrary 移到 src 中,它会起作用。

还有其他一些改进:

  • 在您的 webapplications3 的 project.json 中,PCLLibrray 应该是 移动到根依赖部分而不是 框架的依赖。它不是框架依赖项。
  • 在您的 PCLLibrary 中,NETStandard.Library 应移至 框架依赖项。

【讨论】:

    猜你喜欢
    • 2017-01-03
    • 2017-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-31
    • 2016-10-31
    相关资源
    最近更新 更多