C# 添加System.Runtine 4.3.1时,对System.ComponentModel.Composition的Nuget引用不正确

C# 添加System.Runtine 4.3.1时,对System.ComponentModel.Composition的Nuget引用不正确,c#,azure,dll,nuget,C#,Azure,Dll,Nuget,我使用的是Visual Studio Professional 2019,在为System.Runtime 4.3.1添加nuget软件包时,它会自动添加对System.ComponentModel.Composition的引用。虽然在我的本地计算机上构建成功,但在Azure VM上管道运行时构建失败。Azure VM没有安装Visual Studio,而是使用MSBuild。我确实搜索了它,并阅读了类似的问题答案,但没有帮助。非常感谢您的帮助。虽然我不确定为什么System.Runtime需要

我使用的是Visual Studio Professional 2019,在为System.Runtime 4.3.1添加nuget软件包时,它会自动添加对System.ComponentModel.Composition的引用。虽然在我的本地计算机上构建成功,但在Azure VM上管道运行时构建失败。Azure VM没有安装Visual Studio,而是使用MSBuild。我确实搜索了它,并阅读了类似的问题答案,但没有帮助。非常感谢您的帮助。

虽然我不确定为什么
System.Runtime
需要添加
System.ComponentModel.Composition
的引用,但我可以通过测试确认,在安装
System.Runtime
nuget时,它添加了来自GAC的
System.ComponentModel.Composition
的引用,但并没有添加这个nuget。因此,它在GAC中不存在的机器中出现故障。因此,要修复错误,只需在所需项目中显式添加nuget。

这里有什么问题?没有任何东西阻止您使用nuget安装
System.ComponentModel.Composition
。请在管道上添加
nuget restore
命令。既然问题与Azure有关,您应该添加Azure标记。@PavelAnikhouski我的问题是“为什么在上帝的名字上”System.ComponentModel.Composition“当我添加System.Runtime的nuget软件包时,是否添加了该软件包?@PerryQian MSFT您的评论值得投票,另一个则不值得投票。”。非常感谢。我添加了azure标签。nuget restore命令已在管道中。