问题描述
我有一个.NET项目,其 .csproj
I have a .NET project with the following in its .csproj
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
当我运行 dotnet restore project-file.csproj
时,我得到以下信息:
When I run dotnet restore project-file.csproj
I get the following:
这是为什么?我以为 dotnet cli
也可以与非Core项目一起使用?
Why is this? I thought the dotnet cli
could work with non Core projects too?
我有被引用的nuget软件包,所以我希望cli能够下载nuget软件包.
I have nuget packages that are referenced, so I expect the cli to go and download the nuget packages.
推荐答案
dotnet cli
仅在使用 dotnet new
命令创建项目的情况下才能与.NET Framework一起正常使用.如果从Visual Studio创建项目,则 .csroj
文件的结构将有所不同,并且通常无法对其执行 cli
命令
dotnet cli
works properly with .NET Framework only if the project was created from dotnet new
command. If you create project from Visual Studio the structure of .csroj
files will be different and you usually cannot run cli
commands towards them
这篇关于.NET Framework项目上的dotnet还原无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!