引用旧版本的Microsoft.AspNetCore.App的Visual Studio 2017项目 [英] Visual Studio 2017 project referencing old version of Microsoft.AspNetCore.App

查看:329
本文介绍了引用旧版本的Microsoft.AspNetCore.App的Visual Studio 2017项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是.Net Core 2.1.1,最近将SDK更新为2.1.401(.Net Core Runtime 2.1.3)。当我创建一个新项目时,依赖关系> SDK下的 Microsoft.AspNetCore.App 版本仍为2.1.1。查看依赖关系> NuGet的属性,正在从 C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.app\2.1.1

I was using .Net Core 2.1.1, and recently updated the SDK to 2.1.401 (.Net Core Runtime 2.1.3). When i create a new project the version of Microsoft.AspNetCore.App under Dependencies > SDK is still 2.1.1. Looking at the properties of Dependencies > NuGet, the package is being referenced from "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.app\2.1.1"

我尝试使用NuGet软件包管理器安装软件包2.1.3,尽管我的计算机上已经安装了2.1.3,它还是从NuGet下载了所有依赖项。

I tried installing Package 2.1.3 using NuGet package manager, and it downloaded all dependencies from NuGet despite that i have 2.1.3 already installed on my machine.

如何强制现有/新项目使用SDK安装中的最新版本的软件包?

How do i force existing / new project to use the latest version of packages from the SDK install ?

推荐答案

您不需要在项目中手动更新 Microsoft.AspNetCore.App 的版本。 2.1.1很好。您的应用程序将在计算机上安装的最新2.1。*框架上运行。

You shouldn't need to update the version of Microsoft.AspNetCore.App manually in your project. 2.1.1 is perfectly fine. Your application will run on the latest 2.1.* framework installed on the machine.

如果发布独立的应用程序,该工具将自动切换到最新的已知版本2.1。*在构建时仅适用于独立构建。 ( -r win-x64 参数)

If you publish a self-contained application, the tooling will automatically switch to the latest known version of 2.1.* at build time for the self-contained build only. (-r win-x64 argument)

对于2.2或3.0版本,这可能会更改,也可能不会更改,请阅读/ follow 此GitHub问题和主题以获取更多信息。

This may or may not change for the 2.2 or 3.0 releases, read/follow this GitHub issue and thread for more information.

这篇关于引用旧版本的Microsoft.AspNetCore.App的Visual Studio 2017项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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