You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is reproduced in that repository. Just build it and run ClassicConsoleApp.
Let's assume there is a simple .NET Standard library that has a dependency from Newtonsoft.Json NuGet package. And this library, in turn, is referenced by a classic .NET 4.6.1 console application. This solution builds successfully but during runtime when console application tries to instantiate a class from .NET standard library the following exception is thrown:
System.IO.FileNotFoundException: '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.'
One possible workaround is to manually copy Newtonsoft.Json.dll from C:\Users\{username}\.nuget\packages\newtonsoft.json\9.0.1\lib\netstandard1.0 to the output folder of the classic .NET console application. Maybe msbuild should do it automatically.
When referencing the same library but from .NET Core console application Newtonsoft.Json.dll is also missing in output folder but the program works as expected. In this case Newtonsoft.Json dependency is included in CoreConsoleApp.deps.json that is missing in output folder for the classic .NET application.
CoreConsoleApp.runtimeconfig.dev.json file in .NET Core console app output folder with
could be another hint for runtime to locate Newtonsoft.Json.dll. This file is also missing in classic .NET application's output.
I am working with
Microsoft (R) Build Engine version 15.1.523.56541
and
Microsoft Visual Studio Professional 2017 RC
Version 15.0.26127.0 D15REL
This problem exists at least from August 2016 and was mentioned in this and this stackoverflow questions but there are no solutions yet.
PS. I rechecked this after the recent update of VS 2017 RC, the issue still exists. I also reported this issue at dotnet/msbuild#1582 but had no luck maybe it better fits to this repository.
The text was updated successfully, but these errors were encountered:
This issue is reproduced in that repository. Just build it and run
ClassicConsoleApp
.Let's assume there is a simple .NET Standard library that has a dependency from Newtonsoft.Json NuGet package. And this library, in turn, is referenced by a classic .NET 4.6.1 console application. This solution builds successfully but during runtime when console application tries to instantiate a class from .NET standard library the following exception is thrown:
One possible workaround is to manually copy
Newtonsoft.Json.dll
fromC:\Users\{username}\.nuget\packages\newtonsoft.json\9.0.1\lib\netstandard1.0
to the output folder of the classic .NET console application. Maybe msbuild should do it automatically.When referencing the same library but from .NET Core console application
Newtonsoft.Json.dll
is also missing in output folder but the program works as expected. In this caseNewtonsoft.Json
dependency is included inCoreConsoleApp.deps.json
that is missing in output folder for the classic .NET application.CoreConsoleApp.runtimeconfig.dev.json
file in .NET Core console app output folder withcould be another hint for runtime to locate
Newtonsoft.Json.dll
. This file is also missing in classic .NET application's output.I am working with
and
This problem exists at least from August 2016 and was mentioned in this and this stackoverflow questions but there are no solutions yet.
PS. I rechecked this after the recent update of VS 2017 RC, the issue still exists. I also reported this issue at dotnet/msbuild#1582 but had no luck maybe it better fits to this repository.
The text was updated successfully, but these errors were encountered: