c# - dotnet restore fail "Unable to resolve ' PCLLibrary' for '.NETCoreApp,Version=v1.0'。”

标签 c# .net asp.net-core

我在 .NET CORE 1.0 项目中使用了 PCL 项目('PCLLibrary') 从 Visual Studio 一切正常, 当我尝试从命令行执行 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

最佳答案

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

以及其他一些改进:

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

关于c# - dotnet restore fail "Unable to resolve ' PCLLibrary' for '.NETCoreApp,Version=v1.0'。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38501925/

相关文章:

c# - 委托(delegate)与暴露属性

c# - 用 2 的补码表示十六进制值

c# - UWP 版本构建崩溃,但在 Visual Studio 中不会崩溃

.net - 如何动态加载单独的应用程序设置文件并与当前设置合并?

c# - 如何将@RenderBody() 分成两部分

reactjs - 可本地化的 ASP.NET Core + ReactJS 应用程序

c# - 如何在 .net 核心中获取 HttpRequest 主体?

c# - ASP.NET MVC 和 JQuery 动态表单内容

c# - Razor 模板中的可空日期时间错误

c# - 带有 retrofit 的多部分内容