I have a simple Dll where I defined some class like this:
public class Parameters
{
public string Message { get; set; }
}
I added a NuGet package Newtonsoft.Json
.
This DLL MUST be consumed by a netcoreapp1.1 and a net462.
I have tried to modify the csproj and added this
<TargetFramework>netstandard1.5</TargetFramework>
If I launch dotnet build the dll was build successfully but I cannot consume the DLL from the netcore app neither from net462
In particular if I add a xUnit
test and reference a class inside the DLL it raise the error:
System.IO.FileLoadException
: Could not load file or assembly 'System.Runtime, Version=4.1.0.0 [..]
Anybody can explain me how work net462
, netcoreapp
and netstandard1.5
target frameworks? And how build a dll cross framework?
UPDATE
For find the related assembly must be add the code below on xunit .csproj
<OutputType>Exe</OutputType>