-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuGet dependencies of .NET Standard library referenced from classic .NET app cannot be resolved at runtime with FileNotFoundException #1582
Comments
I believe this will be fixed once Visual Studio supports |
@dsplaisted But VS 2017 RC already supports it. At least partially because I added a Moreover, when I build the example solution from the command line with |
Found another workaround by creating NuGet package out of .NET Standard library. |
@dsplaisted Unfortunately, the recent update of VS 2017 RC didn't fix this issue. The repository with a repro is updated according to new csproj format. |
Microsoft finally admitted this is a problem and will fix it (NuGet/Home#4488) , expectantly, in NuGet version 4.0.1, the first update to NuGet 4 after VS 2017 ships. The cleanest workaround now is to add However according to Rob Relyea MS will ignore this property after RTM so another workaround is |
As a work around, i modified the the NetStandard project as multi-target:
Rebuild the solution and the referenced dll are copied to bin folder of the legacy console project |
Any update on this ? Having the same problem today on a .Net Framework6.1 ConsoleApp referencing a .NetStandard2.0 Class lib project that uses EasyNetQ.
The only way i can get it to work is adding Thanks all. |
Aha,Find a temp workgroud here |
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.
The text was updated successfully, but these errors were encountered: