locked
C# projects output unwanted BouncyCastle RRS feed

  • Question

  • Why do my C# projects contain BouncyCastle and other unwanted, unused and unrequested Dlls and how do I get rid of it.
    Monday, September 28, 2020 10:10 PM

Answers

  • Hello,

    References like BouncyCastle are installed because

    • You added the reference 
    • You added another DLL that requires it as a dependency (many times from a NuGet package).

    You can do the following

    First option

    Make sure your project is not using an NuGet Package, if so it may requires that and other DLL's

    Second option

    • Make a complete backup of your Visual Studio solution.
    • In the project(s) that have these reference remove the reference via opening the reference node of the project
    • Select the reference and press DEL.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by CoolDadTx Tuesday, September 29, 2020 1:37 PM
    • Marked as answer by PinoyCSharpCoder Wednesday, September 30, 2020 12:33 AM
    Tuesday, September 29, 2020 12:33 AM

All replies

  • Hello,

    References like BouncyCastle are installed because

    • You added the reference 
    • You added another DLL that requires it as a dependency (many times from a NuGet package).

    You can do the following

    First option

    Make sure your project is not using an NuGet Package, if so it may requires that and other DLL's

    Second option

    • Make a complete backup of your Visual Studio solution.
    • In the project(s) that have these reference remove the reference via opening the reference node of the project
    • Select the reference and press DEL.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by CoolDadTx Tuesday, September 29, 2020 1:37 PM
    • Marked as answer by PinoyCSharpCoder Wednesday, September 30, 2020 12:33 AM
    Tuesday, September 29, 2020 12:33 AM
  • The culprit was MySql.Data.dll. It had the "Copy Local" property set to true. When the project is compiled it copies MySql.Data.dll and 8 other dlls to the output directory of which one is BouncyCastle. If I delete these 8 dlls, my program still runs without error. So I changed the "Copy Local" property to false and it does not copy dlls. But this is not the end of the problem. Any project that referenced my dll with "Copy Local" will also copy the extraneous 8 dlls. This resulted in many dozens of copies of these dlls. So to fix it I have to set all references to my dll to "Copy Local" = false and then manually copy my dll. Does anyone know how to eliminate these 8 unnecessary dlls so I don't have to copy my output manually?


    Wednesday, September 30, 2020 12:47 AM