我有一个.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:
无事可做.指定的项目均不包含要还原的软件包.
Nothing to do. None of the projects specified contain packages to restore.
这是为什么?我以为 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还原无法正常工作
发布评论