vb.net startup form versus module Main()
19:37 20 Sep 2023

Visual basic.net startup form is enabled by default when enable application framework is checked. With this you can code the application events like reflection and you cannot use module Main().

I have a code below in my application, the same as from https://www.youtube.com/watch?v=fYgJMRLTc1A

private withevents domain as appdomain = appdomain.currentdomain
private function domaincheck( etc ... )
   if e.name.contains('name0') then
      return system.reflection.assembly.load(my.resources.resname0)
   elseif e.name.contains('name1') then
      return system.reflection.assembly.load(my.resources.resname1)
   elseif e.name.contains('name2') then
      return system.reflection.assembly.load(my.resources.resname2)
   else
      return nothing
   end if
end function

I wanted to extract a resource before executing the codes in the function domaincheck.

I tried to place my resource extraction in the first line of code inside the domaincheck function but it somehow loops for many times. therefore, the resource extraction is extracted many times as the loop.

Where do I place my resource extract code so that it will not loop?

And can I still use the module Main() as my startup form ? if yes, how can I do that ?

vb.net