Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Why is Castle.Core being added as a dependency to my Nuget package?

$
0
0

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>

enter image description hereenter image description hereenter image description here


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>