I created a VS 2015 U3 solution that contains a netstandard1.3 PCL library X
and a netcoreapp1.0 test library Y
. I'm using MSTest (dotnet-test-mstest and MSTest.TestFramework).
This is src\X\project.json
:
{
"supports": {},
"dependencies": {
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.3": {}
}
}
This is test\Y\project.json
:
{
"version": "1.0.0-*",
"testRunner": "mstest",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"dotnet-test-mstest": "1.0.1-preview",
"MSTest.TestFramework": "1.0.0-preview",
"X": { "target": "project" }
},
"frameworks": {
"netcoreapp1.0": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},
"runtimes": {
"win8-x64": {}
}
}
It turned out that I need to have this last
"runtimes": {
"win8-x64": {}
}
in Y\project.json
, otherwise I get the following error:
_dotnet-test Error: 0 : System.InvalidOperationException: Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win81-x64, win8-x64, win7-x64'._
Why is that? Can't I have a generic test app that will work everywhere if I install the SDK?