Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

c# - Incorrect Nuget Reference to System.ComponentModel.Composition when I am adding System.Runtine 4.3.1

I am using Visual Studio Professional 2019 and when adding nuget package for System.Runtime 4.3.1 it automatically adds reference to System.ComponentModel.Composition . Though build is successful on my local machine, it fails on Azure VM when pipeline runs. Azure VM does not have Visual Studio installed it uses MSBuild. I did search it and read similar question answer but didn't help. Any help would be highly appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

While I am not sure exactly why System.Runtime needs to add reference of System.ComponentModel.Composition, but I can confirm from my testing that while installing System.Runtime nuget it adds a reference of System.ComponentModel.Composition from GAC, but does not add that nuget. Hence it is failing in machine where it's not present in GAC. So, to fix your error just add the nuget System.ComponentModel.Composition explicitly in your required project.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...