Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Annoying VS auto-add "using"

Annoying VS auto-add "using"

Scheduled Pinned Locked Moved The Lounge
javascriptvisual-studiocomsecurityperformance
12 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    50% of the time, this is a nice feature. The other 50%, I hate it as I have to clean up the BS it adds. Like

    using static System.Runtime.InteropServices.JavaScript.JSType;
    using System.Runtime.Intrinsics.X86;
    using System.Security.Policy;
    using Twilio.TwiML.Voice;

    Seriously? Where does it think I need those??? :rolleyes: And yes, I know I can turn this off, somewhere, but the 50% when I like it, I want it. :laugh:

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    H P R M 4 Replies Last reply
    0
    • M Marc Clifton

      50% of the time, this is a nice feature. The other 50%, I hate it as I have to clean up the BS it adds. Like

      using static System.Runtime.InteropServices.JavaScript.JSType;
      using System.Runtime.Intrinsics.X86;
      using System.Security.Policy;
      using Twilio.TwiML.Voice;

      Seriously? Where does it think I need those??? :rolleyes: And yes, I know I can turn this off, somewhere, but the 50% when I like it, I want it. :laugh:

      Latest Articles:
      A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

      H Offline
      H Offline
      honey the codewitch
      wrote on last edited by
      #2

      It shouldn't do it when it has to autocomplete the referenced item. For example, if it autocompletes ThreadPool but you didn't type it it shouldn't add the using System.Threading.

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      M 1 Reply Last reply
      0
      • M Marc Clifton

        50% of the time, this is a nice feature. The other 50%, I hate it as I have to clean up the BS it adds. Like

        using static System.Runtime.InteropServices.JavaScript.JSType;
        using System.Runtime.Intrinsics.X86;
        using System.Security.Policy;
        using Twilio.TwiML.Voice;

        Seriously? Where does it think I need those??? :rolleyes: And yes, I know I can turn this off, somewhere, but the 50% when I like it, I want it. :laugh:

        Latest Articles:
        A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        What language? ;P I just delete them all. I use the using directive only for aliases and for adding Extension Methods.

        Richard Andrew x64R 1 Reply Last reply
        0
        • M Marc Clifton

          50% of the time, this is a nice feature. The other 50%, I hate it as I have to clean up the BS it adds. Like

          using static System.Runtime.InteropServices.JavaScript.JSType;
          using System.Runtime.Intrinsics.X86;
          using System.Security.Policy;
          using Twilio.TwiML.Voice;

          Seriously? Where does it think I need those??? :rolleyes: And yes, I know I can turn this off, somewhere, but the 50% when I like it, I want it. :laugh:

          Latest Articles:
          A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

          R Offline
          R Offline
          Ron Nicholson
          wrote on last edited by
          #4

          There is also a setting that allows it to remove unused ones on build. Might keep you from manually deleting them. HTH

          Jack of all trades, master of none, though often times better than master of one.

          H M 2 Replies Last reply
          0
          • R Ron Nicholson

            There is also a setting that allows it to remove unused ones on build. Might keep you from manually deleting them. HTH

            Jack of all trades, master of none, though often times better than master of one.

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #5

            Personally, I can't use that one either without extra configuration work. The reason being is I often target the dotnet framework as well as the newer dotnet offerings, and the newer ones have things like System.Collections.Generic already implicitly declared. Sharing the source file between each would cause an error in the DNF version if the newer dotnet version of the project gets built.

            Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

            1 Reply Last reply
            0
            • P PIEBALDconsult

              What language? ;P I just delete them all. I use the using directive only for aliases and for adding Extension Methods.

              Richard Andrew x64R Offline
              Richard Andrew x64R Offline
              Richard Andrew x64
              wrote on last edited by
              #6

              Do you mean you use fully qualified type names for all of your variables? That must become tedious after a while.

              The difficult we do right away... ...the impossible takes slightly longer.

              P 1 Reply Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                Do you mean you use fully qualified type names for all of your variables? That must become tedious after a while.

                The difficult we do right away... ...the impossible takes slightly longer.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                Not the "basic" ones with built-in aliases like int and string, but all the rest, yes. It's my preference. It aids my memory.

                1 Reply Last reply
                0
                • M Marc Clifton

                  Maybe that's the problem. I hit Enter expecting what I'm seeing to autocomplete but it does something totally different. I think I often jump the gun on the auto-complete. :laugh:

                  Latest Articles:
                  A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #8

                  That's exactly what happens to me.

                  Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                  1 Reply Last reply
                  0
                  • H honey the codewitch

                    It shouldn't do it when it has to autocomplete the referenced item. For example, if it autocompletes ThreadPool but you didn't type it it shouldn't add the using System.Threading.

                    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #9

                    Maybe that's the problem. I hit Enter expecting what I'm seeing to autocomplete but it does something totally different. I think I often jump the gun on the auto-complete. :laugh:

                    Latest Articles:
                    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                    H 1 Reply Last reply
                    0
                    • R Ron Nicholson

                      There is also a setting that allows it to remove unused ones on build. Might keep you from manually deleting them. HTH

                      Jack of all trades, master of none, though often times better than master of one.

                      M Offline
                      M Offline
                      Marc Clifton
                      wrote on last edited by
                      #10

                      Ron Nicholson wrote:

                      There is also a setting that allows it to remove unused ones on build.

                      I'll have to try that! Thanks!

                      Latest Articles:
                      A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                      R 1 Reply Last reply
                      0
                      • M Marc Clifton

                        Ron Nicholson wrote:

                        There is also a setting that allows it to remove unused ones on build.

                        I'll have to try that! Thanks!

                        Latest Articles:
                        A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                        R Offline
                        R Offline
                        Ravi Bhavnani
                        wrote on last edited by
                        #11

                        VS renders unused usings in a lighter color and I use the built in Sort and Remove Unused Usings command to clean things up. /ravi

                        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          50% of the time, this is a nice feature. The other 50%, I hate it as I have to clean up the BS it adds. Like

                          using static System.Runtime.InteropServices.JavaScript.JSType;
                          using System.Runtime.Intrinsics.X86;
                          using System.Security.Policy;
                          using Twilio.TwiML.Voice;

                          Seriously? Where does it think I need those??? :rolleyes: And yes, I know I can turn this off, somewhere, but the 50% when I like it, I want it. :laugh:

                          Latest Articles:
                          A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                          M Offline
                          M Offline
                          mikemkii
                          wrote on last edited by
                          #12

                          Agree it's annoying. Probably the main reason for my excessive usage of: CTRL R+G - remove unused references and sort the others. CTRL K+E - offically "code cleanup", but for me at least: seems to do R+G and K+D for spacing things ...choice of each mostly dependent on mood.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups