You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I aim to exclude specific references to a library or any transitive dependencies during the solution build, with the desired outcome being a build error.
This code is designed to function with explicit dependencies.
If I run the build it succesfully prompt that I cannot use Microsoft.AspNetCore.Mvc.Abstractions:2.2.0.
The current process fails when attempting to check for transitive dependencies. To address this, I need to switch from using %(PackageReference) to %(PackageDependencies). However, the latter does not include any Version metadata; its value is consistently empty.
I'd try to implement the check by parsing the output of dotnet list package --include-transitive --format=json. Or if I had to support an older version of .NET SDK that does not implement --format=json, then I'd try parsing project.assets.json even if its structure is not documented. PowerShell would be able to parse the JSON and compare versions pretty easily.
That works, and that's how I know which package I should provide to run tests. But it's not my goal: my intention is to automate the checking process during the application build.
IIRC some item type with "Reference" in its name lists DLL files and has metadata about NuGet package names and versions if the DLLs came from a package. But this would not let you detect packages that do not contain any DLLs.
I aim to exclude specific references to a library or any transitive dependencies during the solution build, with the desired outcome being a build error.
This code is designed to function with explicit dependencies.
If I run the build it succesfully prompt that I cannot use
Microsoft.AspNetCore.Mvc.Abstractions:2.2.0
.The current process fails when attempting to check for transitive dependencies. To address this, I need to switch from using
%(PackageReference)
to%(PackageDependencies)
. However, the latter does not include anyVersion
metadata; its value is consistently empty.The text was updated successfully, but these errors were encountered: