【发布时间】:2020-02-19 10:29:08
【问题描述】:
我有一个问题,我有一个 Visual Studio 解决方案,其中包含具有微服务架构的不同项目,并且有一个项目具有所有微服务的通用功能,在该项目中我有启动方法,以免在不同的项目中重复代码微服务。问题是在微服务的 Api 项目中,我在启动时使用了 app.UseEndpoints 方法,当我尝试将此代码传输到 .NET Standard 2.1 中的公共项目时,它不允许我安装更新版本nuget 包:Microsoft.AspNetCore.Routing 版本 2.2.2 日期:12/09/2019 而不是 Api 项目提取 .NET Core 3.1.1 的版本
项目 API-REST 微服务:
assembled Microsoft.AspNetCore.Routing, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
当我将该 nuget 包安装到 net Standard 2.1 项目中时,程序集如下:
assembled Microsoft.AspNetCore, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
我可以将 Microsoft.AspNetCore 3.1.0 包中的一些功能引入 net Standard 2.1 项目吗?
【问题讨论】:
标签: c# asp.net-core asp.net-web-api .net-core asp.net-core-mvc