简体   繁体   English

vNext项目编译时VS 2015“依赖无法解决”错误

[英]VS 2015 “Dependency could not be resolved” error on vNext project compilation

I am trying to add Newtonsoft.json nugget package to my project and getting the following error on compilation, 我正在尝试将Newtonsoft.json nugget包添加到我的项目中并在编译时收到以下错误,

"NU1001 The dependency Newtonsoft.Json >= 7.0.1 could not be resolved." “NU1001依赖Newtonsoft.Json> = 7.0.1无法解析。”

It works fine if I install the package version <= 6.0.6. 如果我安装包版本<= 6.0.6,它工作正常。 I also tried running dnu restore (apparently worked for someone else) from the powershell in the root folder of the project. 我还尝试从项目根文件夹中的powershell运行dnu restore (显然适用于其他人)。 Same error. 同样的错误。 Also tried installing via Nugget manager and adding the package name directly in the project.json and letting the VS restore itself. 还尝试通过Nugget管理器进行安装,并直接在project.json中添加包名,让VS自行恢复。

I am trying to build on dnx451 framework beta8 version. 我正在尝试在dnx451框架beta8版本上构建。

Does any of the default Framework dependencies require the 6.0.6 version? 是否有任何默认的Framework依赖项需要6.0.6版本? If so, are there any workarounds to this. 如果是这样,有没有解决方法。 I have other projects that requires the latest nugget package and which when referred from the vNext project, throws reference mismatch errors. 我有其他项目需要最新的nugget包,当从vNext项目引用时,抛出引用不匹配错误。

Appreciate any help! 感谢任何帮助!

You can include Newtonsoft.json 7.0.1. 您可以包含Newtonsoft.json 7.0.1。 Maybe something wrong with your project.json. 也许你的project.json有问题。

This is my 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" ]
}
}

This is my dnu restore result 这是我的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/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#VS2015 Express:主引用...无法解析,因为它间接依赖于.NET Framework程序集 - C# VS2015 Express: The primary reference … could not be resolved because it has an indirect dependency on the .NET Framework assembly VS 2015中无法解决Microsoft.NETCORE.app依赖项 - Microsoft.NETCORE.app dependency not resolved in VS 2015 VS2015 GSL编译错误 - VS2015 gsl compilation error 在VS 2015中创建.Net 4.5.2项目的问题。似乎得到vNext项目 - Issue creating .Net 4.5.2 project in VS 2015. Seem to get vNext Project 错误“未为项目设置OutputPath属性” VS 2015 - Error “The OutputPath property is not set for project” VS 2015 VS 2015 MSBuild部署数据库项目错误 - VS 2015 MSBuild Deploy Database Project Error VS 2015 + vNext + Azure:发布有效,但SCM部署不起作用吗? - VS 2015 + vNext + Azure: Publish works, but SCM deploy doesn't? 如何更改安装项目版本(TFS 2015 [vNext build]) - How to change setup project version (in TFS 2015 [vNext build]) VS2015 Ionic 2调试错误:找不到起始页面 - VS2015 Ionic 2 Error on debug: could not locate the start page vs 2015 comunity deploye错误无法找到appxrecipe文件 - vs 2015 comunity deploye error Could not locate the appxrecipe file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM