简体   繁体   中英

ASP.Net Core - Where to find the Nuget packages installed list in the project

I have an ASP.Net Core 2.2 application.

MyApp.Sln

  • MyApp.API (ASP.Net Core 2.2 API Based project)
  • MyApp.Services (CL-Class Library)
  • MyApp.Contracts - (CL-Class Library)
  • My.Services.Tests - (CL-Class Library)

The above projects have different libraries( NuGet packages ) installed

In .Net framework we used to have packages.config thats lists the nuget packages with the version details.

Where I can find the same details in .Net Core 2.2 ?

Because different project in one sln should not have different version of NuGet.

Thanks!

您可以右键单击“解决方案资源管理器”中的项目,然后在该文件中编辑(例如MyApp.Services.csproj),您将看到“包”

I don't believe there is anything equal to packages.config in .Net Core (possible reason - it aims to be more modular). You will have to make a little bit of work to solve your issue.

The quickest way to get dependecy graph is to run

dotnet msbuild YourProject.sln /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=graph.dg

from terminal. Then you can open it with any editor and view all your dependencies in one file.

If this file isn't enough for you, you will (unfortunately) have to do a little bit of dirty work. See this answer View nuget package dependency hierarchy for some really good solutions, like how to write your own application to print dependencies, or how to use NPM.

You can follow this link to see options

Default command Running in the project folder - Shows all packages, by default

dotnet list package <optional project path or solution path>

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