Create a .NET standard library project (d15prerel 26127)
Add a NuGet Reference to Json.Net (using PackageReference in the csproj)
Build
Observed:
Newtonsoft.Json.dll is not copied to output
/cc; @rrelyea
@srivatsn --- known issue? unni and team feel like this is critical.
@rrelyea Isn't this the intended behavior? My understanding is that generally library projects targeting .NET Standard or .NET Core will not have their dependencies copied to the output folder, and that .NET Core apps generally won't either, and the dependencies will generally be loaded from the packages folder via the deps.json file.
We dont' have a deps.json in .NET Desktop apps. What this means is that a .NET Desktop app that references a .NET Standard Library with some dependencies, will fail at runtime with FileNotFoundException.
We dont' have a deps.json in .NET Desktop apps. What this means is that a .NET Desktop app that references a .NET Standard Library with some dependencies, will fail at runtime with FileNotFoundException.
That sounds like #757
Duping this against https://github.com/NuGet/Home/issues/4488
Same issue. Update?
@GreatFireWall what's your issue? a part of it is "by design". you can also open a new issue if something isn't covered.
sorry, resolved.
add <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
in project file.
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
doesn't seem to help with the test case I have here. The repo contains a class library (.NET Standard) which uses JSON.NET. When the class library is compiled and the assembly added as a reference to the console app (.NET Framework) it throws an exception System.IO.FileNotFoundException
. I've added the RestoreProjectStyle
to the csproj file.
@mhingston Did you find a solution to this problem?
add to csproj
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
after
<TargetFramework>netstandard2.0</TargetFramework>
may be it hepls
or try change
<TargetFramework>netstandard2.0</TargetFramework>
to
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
net472 = .NET Framework 4.7.2 change to your .NET Framework version
add to csproj
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
after
<TargetFramework>netstandard2.0</TargetFramework>
may be it heplsor try change
<TargetFramework>netstandard2.0</TargetFramework>
to
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
net472 = .NET Framework 4.7.2 change to your .NET Framework version
It worked for me.
Most helpful comment
add to csproj
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
after
<TargetFramework>netstandard2.0</TargetFramework>
may be it hepls
or try change
<TargetFramework>netstandard2.0</TargetFramework>
to
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
net472 = .NET Framework 4.7.2 change to your .NET Framework version