Raise Compile Error When Using DateTime.Now #74042
-
Hi, is there any way to raise a compile error when Using |
Beta Was this translation helpful? Give feedback.
Answered by
CyrusNajmabadi
Jun 18, 2024
Replies: 2 comments 1 reply
-
Yes. You can write an analyzer that blocks this. Or look at the banned-api analyzer in GitHub.com/dotnet/roslyn-analyzers |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Alirexaa
-
@CyrusNajmabadi thanks for your answer. The banned-api analyzer works, and I am interested in writing an analyzer. is there any article or manual about it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. You can write an analyzer that blocks this. Or look at the banned-api analyzer in GitHub.com/dotnet/roslyn-analyzers