= 7.0.1 无法解析。” 如果我-6ren">
gpt4 book ai didi

visual-studio-2015 - VS 2015 "Dependency could not be resolved"vNext 项目编译错误

转载 作者:行者123 更新时间:2023-12-03 08:30:30 25 4
gpt4 key购买 nike

我正在尝试将 Newtonsoft.json nugget 包添加到我的项目中,并在编译时出现以下错误,

“NU1001 依赖项 Newtonsoft.Json >= 7.0.1 无法解析。”

如果我安装包版本 <= 6.0.6,它工作正常。我也试过运行 dnu 恢复 (显然为其他人工作)来自项目根文件夹中的powershell。同样的错误。还尝试通过 Nugget 管理器安装并直接在 project.json 中添加包名称并让 VS 自行恢复。

我正在尝试构建 dnx451 框架 beta8 版本。

是否有任何默认框架依赖项需要 6.0.6 版本?如果是这样,是否有任何解决方法。我有其他项目需要最新的 nugget 包,当从 vNext 项目引用时,会引发引用不匹配错误。

感谢任何帮助!

最佳答案

您可以包含 Newtonsoft.json 7.0.1。也许你的 project.json 有问题。

这是我的 project.json。

{
"webroot": "wwwroot",
"userSecretsId": "aspnet5-GGZDBC5-d96c66a6-1a4e-4a9a-b8d4-11c2f88ff638",
"version": "1.0.0-*",
"dependencies": {
"CsvHelper": "2.13.1",
"EntityFramework.Commands": "7.0.0-beta8",
"EntityFramework.SqlServer": "7.0.0-beta8",
"Microsoft.ApplicationInsights.AspNet": "1.0.0-beta8",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta8",
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta8",
"Microsoft.AspNet.Authentication.Google": "1.0.0-beta8",
"Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta8",
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta8",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta8",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta8",
"Microsoft.AspNet.Http": "1.0.0-beta8",
"Microsoft.AspNet.Http.Features": "1.0.0-beta8",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta8",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta8",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta8",
"Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta8",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
"Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta8",
"Microsoft.Framework.Logging": "1.0.0-beta8",
"Microsoft.Framework.Logging.Console": "1.0.0-beta8",
"Microsoft.Framework.Logging.Debug": "1.0.0-beta8",
"Microsoft.Framework.SecretManager": "1.0.0-beta8",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta8",
"Newtonsoft.Json": "7.0.1-*",
"Mvc6.JQuery.Datatables": "1.0.0-*",
"npm": "1.4.15.2",
"TagHelpers": "1.0.0-*"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"dependencies": {
"DataTables": "1.0.0-*",
},
"frameworkAssemblies": {
"System.Web": "4.0.0.0"
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc",
"Metronic"
],
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
}

这是我的 dnu 恢复结果
c:\git\DBC\src\DBC>dnu restore
Microsoft .NET Development Utility Clr-x86-1.0.0-beta8-15858

CACHE https://www.myget.org/F/aspnetrelease/api/v3/index.json
CACHE http://www.myget.org/F/azureadwebstacknightly/api/v3/index.json
CACHE https://api.nuget.org/v3/index.json
Restoring packages for c:\git\DBC\src\DBC\project.json
GET https://www.myget.org/F/aspnetrelease/api/v3/flatcontainer/newtonsoft.json/index.json
GET https://www.myget.org/F/azureadwebstacknightly/api/v3/flatcontainer/newtonsoft.json/index.json
CACHE https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
NotFound https://www.myget.org/F/aspnetrelease/api/v3/flatcontainer/newtonsoft.json/index.json 359ms
NotFound https://www.myget.org/F/azureadwebstacknightly/api/v3/flatcontainer/newtonsoft.json/index.json 1406ms
Writing lock file c:\git\DBC\src\DBC\project.lock.json
Restore complete, 3216ms elapsed

NuGet Config files used:
C:\Users\Thom\AppData\Roaming\NuGet\nuget.config

Feeds used:
https://www.myget.org/F/aspnetrelease/api/v3/flatcontainer/
https://www.myget.org/F/azureadwebstacknightly/api/v3/flatcontainer/
https://api.nuget.org/v3-flatcontainer/

关于visual-studio-2015 - VS 2015 "Dependency could not be resolved"vNext 项目编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33532247/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com