我正在设计基本应用程序,我需要利用我使用.Net
编写的现有Framework 4.5
库
我正在尝试设计以下结构:
-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
理解:
Business.csproj
定位框架netstandard1.6
,同时.NET Framework (4.5.x)
& .NET Core
实现
netstandard1.6
WebApi.csproj
定位框架netcoreapp1.1
,因为它需要ASP.NET核心功能&引用项目
{strong> Business.csproj
建立在netstandard1.6
现在尝试恢复包时 - 我遇到以下错误:
一个或多个软件包与.NETCoreApp,Version = v1.1不兼容。
- 醇>
包Microsoft.Composition 1.0.27与netcoreapp1.1(.NETCoreApp,Version = v1.1)不兼容。软件包Microsoft.Composition 1.0.27支持:portable-net45 + win8 + wp8 + wpa81(.NETPortable,Version = v0.0,Profile = Profile259)
错误一个或多个程序包与.NETCoreApp,Version = v1.1不兼容。
答案 0 :(得分:0)
如果你使用的是project.json,那么你需要在project.json中添加一个导入部分:
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "portable-net45+win8+wp8+wpa81"
}
}
如果你正在使用.csproj,那么你需要像这样修改.csproj文件:
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>