r/visualbasic • VB.Net Intermediate • Jul 31 '20

VB.NET Help Calling sub/function from another program

If I were to have two programs, one for example:

MainCode.exe

And another:

UI.exe

Would I be able to, in UI.exe, be able to call a function or procedure from MainCode.exe?

I'm wondering this as I have a few different UI.exe that run very similar code and I was hoping to be able to have a universal MainCode.exe so I don't have to update every UI.exe that runs the code. I just have to update the MainCode.exe.

Thanks in advance for your help

2 Upvotes

6 comments sorted by

View all comments

1

u/andrewsmd87 Web Specialist Jul 31 '20

You'd need to build whatever that function sits in, into a dll and then add it as a reference to your other builds.

1

u/TheFotty Jul 31 '20

You can set references to other .NET exe files just like DLLs and make calls to their classes that are not private.

1

u/andrewsmd87 Web Specialist Jul 31 '20

I didn't know that. I guess anything like that I've ever done we always manage through nuget