Reputation: 2784
I am in process of designing a basic application, where I would need to utilize my existing .Net
libraries which I have written using Framework 4.5
I am trying to design following structure:
-CODE
-Business.csproj
- TargetFramework - netstandard1.6
- ProjectReference - domain.csproj built on .NET 45 framework.
- WebApi.csproj
-TargetFramework - netcoreapp1.1
- ProjectReference - Business.csproj
-TEST
- Business.Tests.csproj
- TargetFramework - netstandard1.1
- ProjectReference - domain.csproj built on .NET 45 framework.
- ProjectReference - Business.csproj built on netstandard1.6 framework.
- WebAPI.Tests.csproj
-TargetFramework - netcoreapp1.1
- ProjectReference - Business.csproj
- ProjectReference - WebApi.csproj
Understanding:
Business.csproj
is targeting framework netstandard1.6
, as both .NET Framework (4.5.x)
& .NET Core
implements
netstandard1.6
WebApi.csproj
is targeting framework netcoreapp1.1
as it is need for ASP.NET Core features & referencing project
Business.csproj
built on netstandard1.6
Now when try to restore packages - I am getting following errors:
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Composition 1.0.27 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
Error One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Upvotes: 0
Views: 89
Reputation: 93434
If you are using project.json then you need to add an imports section to the project.json:
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "portable-net45+win8+wp8+wpa81"
}
}
If you're using .csproj then you need to modify the .csproj file like this:
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
Upvotes: 0