[英]How to configure dependencies correctly
What I would basically like to know is if there is a way of knowing which versions of all the NuGet packages my project depends on/requires, so that I can configure each one accordingly. 我基本上想知道的是,是否有一种方法可以知道我的项目依赖/需要的所有NuGet软件包的哪个版本,以便我可以相应地配置每个版本。 A PowerShell command that would provide the above would be great.
可以提供上述功能的PowerShell命令会很棒。
I receive the below error when I build my solution: 构建解决方案时,我收到以下错误:
Severity Code Description Project File Line Suppression State Error The "Csc" task failed unexpectedly.
严重性代码说明项目文件行抑制状态错误“ Csc”任务意外失败。 System.TypeLoadException: Could not load type 'System.ValueTuple`3' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
System.TypeLoadException:无法从程序集“ mscorlib,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089”中加载类型“ System.ValueTuple`3”。
at Microsoft.CodeAnalysis.BuildTasks.ManagedToolTask.GenerateCommandLineCommands() at Microsoft.Build.Utilities.ToolTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() NBC.CMS.Cms在Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()在Microsoft.Code.Analysis.BuildTasks.ManagedToolTask.GenerateCommandLineCommands()在.TaskBuilder.d__26.MoveNext()NBC.CMS.Cms
If you are using Visual Studio, you can quickly see the Dependencies and what version they are expected by the following: 如果您使用的是Visual Studio,则可以通过以下方式快速查看依赖关系以及所需的版本:
.NET-Framework Solutions .NET框架解决方案
.NET-Core .NET核心
If you are looking for a CLI solution, try the following solutions. 如果您正在寻找CLI解决方案,请尝试以下解决方案。
Visual Studio 视觉工作室
PowerShell (outside of Visual Studio) PowerShell(Visual Studio外部)
Some answers referenced here: 这里引用了一些答案:
Get a list of all NuGet packages used in a solution 获取解决方案中使用的所有NuGet软件包的列表
How to list all installed NuGet Packages? 如何列出所有已安装的NuGet软件包?
Get-Module -listavailable
然后找到版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.