You can have one assembly, but with several modules compiled in different languages. You would create three projects:
- VB.NET specific code project
- C # code project
- Exe project
Now you cannot use Visual Studio to create it (AFAIK, but you can play with project / MSBUILD files for this), but you must use command line compilers to create network modules.
Using csc.exe (for C #), you should use the /target:module command-line option, and with vbc.exe (for VB.NET), you should also use the /target:module command-line option.
Then, when creating the EXE project, you should use the command line compiler (depending on the language) and use /addmodule:<module> (assuming the EXE project is in C #) or /addmodule:<module> (assuming the EXE project located in VB.NET) to point to the modules that you specified for inclusion in the EXE assembly.
You also have the option of compiling everything into modules and using Assembly Linker (Al.exe) to create an output assembly .
If the above option does not suit you, then another option is to choose one language and use it.
If you use VB.NET, then you will have exception filters (which you specified is the fragment that you need, which is a language function, and not open through the framework).
If you use C #, you do not have exception filters, but you can simulate them as indicated by George Duckett to respond .
source share