'Replacement for obsolete Assembly.CodeBase in .NET 6 / .NET Core

We deploy a helper-executable along with our VSTO / Outlook AddIn via ClickOnce.

In the AddIn, we have a button which starts this helper-executable in a new process (it's needed because the AddIn runs as 32-bit / coupled with Outlook-bitness).

Until now I managed it by using Assembly.CodeBase to get the path of the installed VSTO dll, where I also can find the helper-executable.

I can not use Assembly.Location since this points to another cryptic cache-path where I can only find the current dll, not my installed bunch of dlls with helper-executable.

Now the problem: in .NET core / .NET 6, Assembly.CodeBase is obsolete, so how can I find my helper-executable in my outlook add-in?

Any other ideas, how to achieve that? Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source