Create Error with custom text that prevents compiling in VB.NET (#error in C#) -


you can add preprocessor directive cause error @ compile time in c# this:

#error cause divide 0 

how can same this in vb.net?

or

is there way create error provides custom helpful information in errorlist.

tldr: i want in vb.net:

photo taken c# project

here 1 way can achieve want. not perfect. meet criteria of:

  • prevents compiling
  • puts custom text in error list window

you first need declare variable custom text want displayed underscores in between each word. (yes underscores annoying necessary)

dim this_is_as_useful_a_description_as_your_gonna_get string

this creates unused variable. in conjunction ide's ability treat warnings errors give close looking for:

enter image description here

you can turn on treat warnings errors going project properties , compile tab. so:

enter image description here


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -