您的位置:首页 > 移动开发

使用VS2017新建的Web项目报错:Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1

2017-06-05 19:40 531 查看
使用VS2017新建的Web项目报错:



看到这样的错误提示,毫无意义。赶脚这应该是VS2017的BUG,没有显示错误的位置。于是用
dotnet restore
手动还原,结果在控制台中终于显示了详细的错误:

C:\Program Files\dotnet\sdk\1.0.0\NuGet.targets(97,5): error : 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) [C:\Users\username\Documents\Admin.Web.Tests\Admin.Web.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.0\NuGet.targets(97,5): error : One or more packages are incompatible with .NETCoreApp,Version=v1.1. [C:\Users\username\Documents\test\Admin.Web.Tests\Admin.Web.Tests.csproj]


错误项目中的
csproj
文件:在
PropertyGroup
节点下增加
portable-net45+win8+wp8+wpa81


解决方案 :右键编辑项目添加下面内容

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PackageTargetFallback>portable-net45+win8+wp8+wpa81</PackageTargetFallback>
</PropertyGroup>


转载:https://q.cnblogs.com/q/91766
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐