I am using Visual Studio 2015. I have created a PCL project. Class Library Portable (IOS, Android and Windows). This PCL is a simple POCO class.
It targets: .NET Framework 4.5, ASP.NET Core 1.0, Windows Phone Silverlight 8, Xamarin.Android, Xamarin.IOS
My PCL is referenced by a Xamarin.IOS app and I want to use the same PCL in my Web API.
I am trying to reference this PCL project from an ASP.NET 5 Web API.
The following is in my project.json:
"dnx451": { "dependencies": { "MyPCL": "1.0.0-*" } }
But I get this error:
Error: The Dependency could not be resolved.
I have tried adding the following under frameworks too but no luck.
".NETPortable,Version=v4.0,Profile=Profile111": {
"dependencies": {
"MyPCL": "1.0.0-*"
}
"frameworkAssemblies": {
"mscorlib": "",
"System": "",
"System.Core": ""
}
}
I have also tried dnu restore... still does not work.
So I upgraded to RC2, but it does not resolve the issue. In project.json now I have:
"dependencies":
{
"NETStandard.Library": "1.5.0-rc2-24027"
}
and I added the following under framework:
"netstandard1.5": {
"imports": "dnxcore50"
}
when I compile my Web API project I get the following 3 errors:
the project has not been restored or restore failed. (though I did run dotnet restore)
The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
Cannot find runtime target for framework '.NETStandard,Version=v1.5' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'
Does anyone know how to resolve this issue?
Is it even possible to reference this PCL from an ASP.NET Core Web API or MVC 6 project?