1

I've just downloaded Visual Studio Enterprise 2015 RC and I'm trying to create a simple ASP.NET 5 application. But each time i'm modifying the project.json to add a dependency, I always have an error. For example, when adding a dependency to Newtonsoft.Json I have :

"Dependency Newtonsoft.Json >= 6.0.8 could not be resolved

I've tried to remove the dnxcore50 framework, but nothing better.

What am I missing ?

See project.json

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta4",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
    "Newtonsoft.Json": "6.0.8"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
  },

  "frameworks": {
    "dnx451": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ]
}

EDIT : Nuget.config is :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
  </packageSources>
  <disabledPackageSources>
    <add key="nuget.org" value="true" />
  </disabledPackageSources>
  <activePackageSource>
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </activePackageSource>
</configuration>

EDIT 2 : If I use this, it's working :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <activePackageSource>
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </activePackageSource>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
</configuration>
5
  • can u share your nuget.config and package manager log ? Commented May 18, 2015 at 14:55
  • the log is : Restoring packages for C:\Users\...\project.json Unable to locate Newtonsoft.Json >= 6.0.8 Writing lock file C:\...\project.lock.json Restore complete, 1325ms elapsed Errors in C:\...\project.json Unable to locate Newtonsoft.Json >= 6.0.8 Commented May 18, 2015 at 15:31
  • 1
    try to enable nuget.org Commented May 18, 2015 at 16:00
  • thanks for your answer, with a cleaned nuget.config, it's working. Don't u want to post an answer that I will mark answered ? Commented May 18, 2015 at 16:15
  • vote my comments if you want Commented May 19, 2015 at 7:44

1 Answer 1

2

Here's the problem:

<disabledPackageSources>
    <add key="nuget.org" value="true" />
</disabledPackageSources>

The nuget.org source is disabled

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.