Export interface classes to dll to extend .exe?

I know the question around exporting dll files from VL has come up a bunch of times before, but I’ll ask this one anyways with our specific use-case.

We have an interface for render styles for a part of our large patch, like this:

Now we would like to be able to extend this library of render styles. Ideally without having to go into the patch and re-export as an .exe every time. That way it could be user extendable eventually.

How far away are we from being able to export a class as a .dll and have our .exe be able to read them in? I remember there was still some issue with the older .NET that was prohibiting that. Has anything changed there with the move to the new .NET? Is it still impossible or is there some hope it could get tackled with appropriate funding?

Actually this is already the “default” for the new 2022.5. branch, which is still in preview though.

Here, libraries by default get compiled into dlls. You could make use of this and separate your project into the part that has a library character and into the other part that is your application.

Now, within your application you reference the library, which will result in precompiling it to a dll.
This workflow works for all libraries that are referenced via nuget dependency. And if you want to have the same for your “source repository” you can have it with the command-line argument --compile-source-packages.

4 Likes

That is music to my ears. Thanks!

I just tried with 2021.4 and while it is not that straight forward the following seems to work:

A file called CalcDLL.vl which looks like this.
image

Export it (as console application, idk if that matters)

Open the resulting solution in Visual Studio:

Go to Project > CalcDLL Properties and change the Output type to Class Library

Build the solution:

Reference the resulting CalcDLL.dll and use it.

dllTest.7z (650.8 KB)

6 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.