.NET Framework项目上的dotnet还原无法正常工作

编程入门 行业动态 更新时间:2024-10-14 20:19:18
本文介绍了.NET Framework项目上的dotnet还原无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个.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还原无法正常工作

本文发布于:2023-11-07 23:23:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   项目   工作   NET   Framework

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!