包与netcoreapp不兼容 [英] Package not compatible with netcoreapp

查看:495
本文介绍了包与netcoreapp不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了Visual Studio 2017.我迁移了在Visual Studio 2015中创建的现有项目。它已经迁移而没有任何错误。但是当我构建解决方案时,我得到100多个错误,说明包[Microsoft.AspNetCore ...]不兼容
与[netcoreapp ...]



这样列出的物品超过100种。我尝试重命名sdk值global.json,删除global.json中的sdk值,修复,卸载&重新安装Visual Studio 2017.但它们都不起作用。


我不知道在这里建议添加net451的位置,因为在迁移过程中会删除projects.json文件。


同一个项目在Visual Studio 2015中运行良好。所有问题都在迁移到Visual Studio 2017后开始。



请告诉我如何获取解决这个问题?


解决方案

嗨lohithml,


欢迎来到MSDN论坛。


>>> 当我构建解决方案时,我得到100多个错误,说明包[Microsoft.AspNetCore ... ]与[netcoreapp ...]不兼容 <


这是因为Visual Studio 2017中的Asp.net核心应用程序,其中包含基于新的基于MSBuild的.NET Core Tools的
1.0最终版本。包含低于1.0版本的包是
不兼容。如此多的软件包,例如
Microsoft.AspNet.Authentication.MicrosoftAccount,,它们在较低的1.0版本上开发了baesd,在Visual Studio 2017上将无法兼容。


所以请耐心等待,直到更新的版本发布,你可以在VS 2017正确使用它。

如果这个包是紧急的,你的程序开发是必要的,请暂时使用VS 2015 。



>>> 我不知道在这里添加net451的位置,因为在迁移时,projects.json文件被删除。


如果你想按照建议添加net451,你可以右键单击项目 - >编辑xx。 csproj->在TargetFramework中添加net451:

< PropertyGroup> 
< TargetFrameworks> netcoreapp1.1; net451< / TargetFrameworks>
< / PropertyGroup>


希望这可以帮到你。


I recently installed Visual Studio 2017. I migrated the existing project which created in Visual Studio 2015. It got migrated without any errors. But when I build the solution I get 100+ errors stating Package [Microsoft.AspNetCore...] is not compatible with [netcoreapp...]

There are more than 100 items listed like this. I tried renaming the sdk value global.json, removing sdk value in global.json, repair, uninstall & reinstalling Visual Studio 2017. But none of them work.

I'm not sure where to add net451 as suggested in here because the projects.json file gets deleted while migration.

The same project was working fine in Visual Studio 2015. All issues started after migrating to Visual Studio 2017.

Please let me know how to fix this?

解决方案

Hi lohithml,

Welcome to the MSDN forum.

>>>when I build the solution I get 100+ errors stating Package [Microsoft.AspNetCore...] is not compatible with [netcoreapp...]

That is because Asp.net core application in Visual Studio 2017, which contains the 1.0 final release of the new MSBuild based .NET Core Tools. It's not compatible with the package lower that 1.0 version. So many packages, for example, Microsoft.AspNet.Authentication.MicrosoftAccount, which developed baesd on the lower 1.0 version will not compatible on the Visual Studio 2017.

So please wait patiently till the much newer version is released, you could use it in VS 2017 properly.
If this package is urgent and necessary for your program development, please use VS 2015 temporarily.

>>>I'm not sure where to add net451 as suggested in here because the projects.json file gets deleted while migration.

If you want to add net451 as suggested, you can right click the project->edit the xx.csproj->add net451 in the TargetFramework:

  <PropertyGroup>
    <TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
  </PropertyGroup>

Hope this can help you.


这篇关于包与netcoreapp不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆