Skip to content

.NET Core class library reference --> System.IO.FileNotFoundException (Newtonsoft.JSON 9.01) #6693

@Legends

Description

@Legends

(VS2015 Update 3 + Patch)

I have a plain .NET console application (.NET 4.6) and reference a .NET core class library that targets NetStandard v1.3. The class library has a reference to Newtonsoft.JSON.

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "Newtonsoft.Json": "**9.0.1**"
  },
  "buildOptions": { "platform": "anycpu" },

  "frameworks": {
    "**netstandard1.3**": {
      "imports": "dnxcore50"
    }
  }
}

The referenced NewtonSoft.JSON package is deployed here:

C:\Users\UserAccount.nuget\packages\Newtonsoft.Json_9.0.1_
The Exception:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in DotNetConsoleApplication.exe

Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

The console application adds a reference to the .net core class library directly from folder:

NetCore46ClassLibrary\bin\Debug\netstandard1.3\NetC‌​ore46ClassLibrary.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions