Virtual Anomaly Virtual Anomaly - 1 month ago 19
Vb.net Question

.NET - Is disabling IIf possible?

We have had a problem in our code with people using

IIf()
where they should really be using
If
.

Is there a way I can override
IIf
to disable it, or make it obsolete by using the
<Obsolete()>
tag?

Answer

You can remove the Microsoft.VisualBasic dll from the project references.

enter image description here

Then you can't use the VB6 functions.

Comments