且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

恢复 Typescript 定义 Nuget 包

更新时间:2023-02-02 18:03:10

我相信您正在经历一种常见的Nuget 误解.这里的问题是(自动)Nuget 还原与安装包不同.Nuget Restore 的目的是下载和解压软件包.它不会还原您的项目或解决方案文件夹的内容.阅读文章以了解有关原因的更多详细信息.有很多人对这种行为感到愤怒,但这是 Nuget 开发人员的选择.

I believe you are experiencing one of common Nuget misconceptions. Problem here is that (Automatic) Nuget Restore is not the same as Install-Package. Aim of Nuget Restore is to download and unpack packages. It will not restore content of your project or solution folders. Read article for more detail on why. There is a lot of people mad about this behavior, but this is the choice of Nuget developers.

在对这个问题的评论中提到了许多解决方案.我个人使用 Install-Package MSBuild.NugetContentRestore 这就是我解决内容文件问题所需的全部内容.

A number of solution is mentioned in comments to this issue. I personally use Install-Package MSBuild.NugetContentRestore which is all I need to resolve content files issue.

希望这会有所帮助.