2

I was doing a code review / pull request merge this morning, and discovered:

"using org.bouncycastle.asn1.ocsp;"

...in a .cs page for my WebAPI.

The most recent previous addition was my adding an early return for an async Task to that file, but nothing that I can see that relates to bouncycastle. An entire solution search shows the same using statement in 2 other places added by other members of the team some months ago, but with no obvious reason for the code to be there.

Removing the using statements in all three places the code continues to work as expected.

Has anyone else seen this before? Could anyone explain what might be happening and why?

2 Answers2

0

you have to remove the double quotes like using org.bouncycastle.asn1.ocsp;, otherwise you will get ; Expected error.

Some developer might have pushed this changes, you can check in the commit history.

Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
  • 2
    I'm not trying to use it or get it to work, I'm trying to work out how it appeared in my code in the first place... – Fraser Booth Dec 18 '22 at 12:31
  • @FraserBooth someone might have pushed this to your repo. check the commits – Vivek Nuna Dec 18 '22 at 12:31
  • according to the Git History, that was me, but I never typed it or asked for it, and the code works fine without it. I'm confused how it can have got there. I assume Intellicode, but why when its not needed. It seems a fairly random thing for Microsoft to be suggesting, so I'm worried of something more sinister lurking and adding it without my consent. – Fraser Booth Dec 18 '22 at 12:43
  • @FraserBooth check if you have added some related code and that time by mistake it got added to your code – Vivek Nuna Dec 18 '22 at 12:53
  • Nothing related unfortunately... – Fraser Booth Dec 18 '22 at 13:33
  • @FraserBooth I have noticed the same thing happening in my .NET code too. There are other random "using" statements I find as well. I have no idea why they are inserted in my code, but it's annoying. Did you find out how to stop this? – BryanCass Aug 16 '23 at 19:31
0

I don't know the exact shortcut but I'm used to press ctrl+E,ctrl+D And ctrl+S and sometime I miss a key and it add that using