Fraser Booth
Fraser Booth

Reputation: 81

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

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?

Upvotes: 8

Views: 2209

Answers (2)

TomEberhard
TomEberhard

Reputation: 1091

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.

Upvotes: 0

user2588273
user2588273

Reputation: 1

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

Upvotes: 0

Related Questions