Dotnet还原无法正常工作

时间:2018-01-02 23:53:34

标签: nuget windows-10 .net-core

更新我: 我刚刚将项目更改为在目标框架下运行 .NET Core v2.0& sdk 2.1.3版本,我只会遇到这些错误:

  

严重级代码描述项目文件行抑制状态   错误NU1202 打包Microsoft.Extensions.FileProviders.Physical 1.1.0   与netcoreapp2.0(.NETCoreApp,Version = v2.0)不兼容。   包Microsoft.Extensions.FileProviders.Physical 1.1.0没有   支持任何目标   构架。 AspNetCoreExample C:\ Users \ Admin \ Source \ Repos \ Examples \ src \ AspNetCoreExample \ AspNetCoreExample.csproj 1

更新II:

虽然以下内容解决了当前问题,但我不确定它是否解决了此问题的根本原因。

删除全局nuget.config文件%AppData%/Nuget/Nuget.config

我通过执行以下操作修复了此问题: 我将项目迁移到.net core 2.0并将global.json更改为指向sdk 2.1.3。 手动删除了AspNetCoreExample中的所有引用,并为所有引用添加了最新版本。

<小时/> 目标框架1.1的问题

从VS 2017中的解决方案进行恢复时:

enter image description here

从cmd(dotnet restore)执行还原时 enter image description here

在程序包管理器控制台中运行dotnet还原

enter image description here enter image description here

  

NuGet.targets(103,5):错误:访问路径'System.Runtime.dll'   被拒绝

安装了.NET Core SDK: enter image description here

.NET主机 enter image description here

现在,当我打开解决方案时,我得到了:

enter image description here

2 个答案:

答案 0 :(得分:0)

将您粘贴的日志条目与其AppVeyor版本进行比较,

https://ci.appveyor.com/project/Autofac/examples

你的机器的NuGet配置似乎被打破了。分析并解决问题。

答案 1 :(得分:0)

您应该将此代码添加到.csproj文件

<RuntimeFramework>2.0.3</RuntimeFramework>

这对我有用。

相关问题