I created an ASP.NET Core RC2 Class Library, named MyHelpers, and got the following on project.json:
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
},
"frameworks": {
"netstandard1.5": {
"imports": [
"dnxcore50",
"portable-net452+win81"
]
}
}
I then created an ASP.NET Core RC2 Class Library for testing, named MyHelpersTests, and got the following in project.json:
"testRunner": "xunit",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"xunit": "2.2.0-beta1-build3239",
"dotnet-test-xunit": "1.0.0-rc2-build10015",
"MyHelpers": "1.0.0"
},
"frameworks": {
"netstandard1.5": {
"imports": [
"dnxcore50",
"portable-net452+win81"
]
}
}
When I compile it I get the error:
Package dotnet-test-xunit 1.0.0-rc2-build10015 is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package dotnet-test-xunit 1.0.0-rc2-build10015 supports:
- net451 (.NETFramework,Version=v4.5.1) - netcoreapp1.0 (.NETCoreApp,Version=v1.0) One or more packages are incompatible with .NETStandard,Version=v1.5.
What am I missing?
Actually your test project cannot be a netstandard1.5
library but a netcoreapp1.0
application (like also stated in the error message and the xunit introduction page). The test assembly need to executable and need a Main() (which is provided by xunit). netstandard1.5
is a subset of netcoreapp1.0
.
I think you also have to change your dependency to "Microsoft.NETCore.App":"1.0.0-rc2-3002702"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With