Results 1 to 3 of 3

Thread: How to remove unused references from a project?

  1. #1

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    How to remove unused references from a project?

    Older versions had a "Remove unused references" button next to their list. It might causing missing problems for some references but I was fine with it.

    In newer versions this button is not available here. However in this link, Microsoft said that you can still doing it. The problem is this right click menu item is not available for me. I cannot see it. Not right clicking on "Solution" neither on "My Project" settings nor "References" tab.

    What I tried is just Ctrl + R, G to removing unused Namespaces in the code.
    My project is still heavy in term of output size since I enabled "Copy to path" property of used references.

  2. #2
    Hyperactive Member Frabulator's Avatar
    Join Date
    Jan 2015
    Location
    USA
    Posts
    393

    Re: How to remove unused references from a project?

    I am using 2019 Community and it seems to be working on it.
    EDIT
    Never mind! It is not there. I do have the option to remove individual ones, which I mistaken for the 'removed unused' option.

    The article you linked was updated earlier this year, so it is possibly only available in the latest version?
    END EDIT

    If you are using NuGets though it should automatically update, and be easy enough to remove unused ones from the NuGet window.

    Question, not really related to the topic, what exactly do you mean by 'My project is still heavy in term of output size '? Like, what are we talking? 100mbs? 1gb?
    Last edited by Frabulator; Jun 8th, 2023 at 07:39 AM.
    Oops, There it goes. Yep... my brain stopped...
    _________________________________

    Useful Things:

    How to link your VB.Net application to Excel

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,905

    Re: How to remove unused references from a project?

    Newer versions of VS seem to be opt-in more than earlier versions were. You got a few references to start with if you created a new project based on the forms template in earlier versions. In VS2022, I don't seem to get much of anything at all by default. It might be that MS just decided to chunk things up in such a way that they didn't think it necessary to include the option.
    My usual boring signature: Nothing

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width