简体   繁体   中英

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. A PowerShell command that would provide the above would be great.

I receive the below error when I build my solution:

Severity Code Description Project File Line Suppression State Error The "Csc" task failed unexpectedly. System.TypeLoadException: Could not load type 'System.ValueTuple`3' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
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

If you are using Visual Studio, you can quickly see the Dependencies and what version they are expected by the following:

.NET-Framework Solutions

  1. Your App.config file will show you all NuGet downloaded dependencies
  2. Follow Solution->Project->References for all NuGet and System dependencies

.NET-Core

  1. Solution->Dependencies->NuGet

If you are looking for a CLI solution, try the following solutions.

Visual Studio

  1. Click Tools->NuGet Package Manager->Package Manager Console
  2. Once the terminal opens, type in "Get-Package"

PowerShell (outside of Visual Studio)

  1. dotnet list package YourSln.sln

Some answers referenced here:

Get a list of all NuGet packages used in a solution

How to list all installed NuGet Packages?

Get-Module -listavailable

然后找到版本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM