关于.NET Core 2.0.2升级到2.1.1版本相关问题

2018-06-24 00:00:08来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

之前,因日常任务管理比较混乱,所以自己开发了PTager任务管理系统。

当时用了.NET Core 2.0版本。

现在想修改相关功能,但.NET Core已发布到2.1.301了,也即2.1.1。

附上修改前的csproj文件:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <UserSecretsId>aspnet-***-05A5CB6C-2204-4A9F-A965-F9D775FAEBFE</UserSecretsId>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="BuildBundlerMinifier" Version="2.6.375" />
    <PackageReference Include="MailKit" Version="2.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-final" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.0.0-preview2-final" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" PrivateAssets="All" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" PrivateAssets="All" />
    <PackageReference Include="NUglify" Version="1.5.10" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
  </ItemGroup>
</Project>  

因为2.1的版本开始,就不建议直接用 Microsoft.AspNetCore.All,所以修改为 Microsoft.AspNetCore.App

其中因为默认用了本地安装的.NET Core 2.1.0,所以和SignalR的1.0.1版本有Http版本引用的冲突,所以需要制定*.App的版本号为2.1.1

修改后的csproj文件如下:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <UserSecretsId>aspnet-***-05A5CB6C-2204-4A9F-A965-F9D775FAEBFE</UserSecretsId>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="BuildBundlerMinifier" Version="2.8.391" />
    <PackageReference Include="MailKit" Version="2.0.4" />
   <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" PrivateAssets="All" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" PrivateAssets="All" />
    <PackageReference Include="NUglify" Version="1.5.11" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
  </ItemGroup>
</Project> 

  

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:C#连接操作MySQL数据库详细步骤 帮助类等(二次改进版)

下一篇:【从零开始搭建自己的.NET Core Api框架】(一)创建项目并集成s