org.bouncycastle.asn1.ocsp appeared in my vs2022 code without my asking?
Asked Answered
M

2

8

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?

Mellophone answered 18/12, 2022 at 12:25 Comment(0)
F
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

Fisken answered 28/3, 2023 at 23:34 Comment(0)
E
0

You might have ImplicitUsings enabled in your .csproj file. In my experience, enabling that leads to weird libraries being added, whether necessary or not. I turn it off: edit the .csproj file and replace 'enable' with 'disable'.

Depending on how much stuff has been added automatically, you will have to do a fair amount of cleanup, including adding the libraries that were implicitly there.

Effervesce answered 11/6, 2024 at 15:59 Comment(1)
Thank you for the thought :) I don't seem to have any ImplicitUsings mentioned in any of the .csproj files in my project. ...but that got me looking into transitive dependencies. It seems that it is, but that still doesn't help me understand why it might then automatically add it in a using statement. The mystery continues!Mellophone

© 2022 - 2025 — McMap. All rights reserved.