I created a VERY basic .NetStandard2.1 class library -- a single class with a single interface. I built the solution and committed to Azure DevOps.
I created a build Pipeline that compiles the library, creates a nuget package and publishes the package to Azure Artifacts.
I then created a .Net 8 console application and used the NuGet Package Manager to load my package from the Azure Artifacts. When I select the package in Package Manager, it shows no dependencies (which is what I expected). But when I try to install it, it shows that it is installing Castle.Core.3.3.3
along with my NuGetTestlib.1.0.0
.
Where is Castle.Core.3.3.3
coming from? Why is that being installed as part of my package?
Class Library
public class Calculator : ICalculator{ public int Compute(int number1, int number2, char operation) { switch (operation) { case '+': return number1 + number2; break; case '-': return number1 - number2; break; default: throw new Exception($"Operation '{operation}' is not supported."); } }}public interface ICalculator{ public int Compute(int number1, int number2, char operation);}
That is my complete class library. No added dependencies or NuGet packages.
Library Project File
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>netstandard2.1</TargetFramework><Nullable>enable</Nullable></PropertyGroup></Project>