Referencing External DLL

IncredulousMe

New member
Messages
4
Reactions
1
Points
3
So I'm new to VAM and Unity scripting, but not C#. Still, I'm running in to an issue and I was hoping someone could point me in the right direction.

I want to reference an external DLL and use its functions in my script. It's unity compliant (SteamVR.dll). When I work with the PluginBuilder solution in VS I can add the reference and use the functions, but in VAM when I load the plugin I get a Reference Missing error so I'm missing something.

I did a search and I couldn't really find an answer. Any help would be greatly appriciated.

Thanks.
 
When you plugin is a DLL, that DLL can reference external DLLs, as long as you provide them, obviously. This might also work with regular non-DLL plugins, but I never tried. However, keep in mind that any external DLL will be limited by the same restrictions as any VaM plugin. So if the external DLL uses Reflection, System.IO or any other stuff blocked by VaM for security reasons, you are screwed. Pretty much any external software will likely use something from that list, since its very basic stuff.
 
Thanks for getting back to me on this. It's much appreciated.
I'm using a dll that came with VAM, SteamVR.dll, so I'm fairly certain it would adhere to the restrictions.
So if I'm understanding this I need to compile my own script in to a dll after I remove the system.reflection references?
 
I'm using a dll that came with VAM, SteamVR.dll, so I'm fairly certain it would adhere to the restrictions.
Nope. Those restrictions are for plugins only, so creators can't (easily) do bad stuff with plugins like installing trojans, viruses, whatever. VaM itself of course does not have those restrictions. If you don't want to share your plugin (and its just a project for yourself), you can work around VaM restrictions by using something like Illusion Plugin Architecture to patch VaM.exe so that if will just load anything it finds in a particular folder. Of course then you would work around VaM's plugin interfaces entirely and you be totally on your own, VAR packages won't work, etc. That's what we used before VaM had official plugin support. But yeah, don't share plugins made with that as the majority of the users here won't understand the tremendous security risk!
 
Got it.
Eventually I'd like to make a plugin for release so I'll stay away from patching the vam.exe and see what I can do about getting this loaded in.

Thanks for the help!
 
Hi IncredulousMe, I also want to compile my plugin scripts to a dll.
How did you do it in VS? Which template you used when creating a new project in VS?
Thank you!
 
Class Library ( .NET Framework) C#

why go for a dll !?
Thanks for replying!
I'd like to reference a external dll.
I got it to work by using Class Library ( .NET Framework). I tried to use Class Library but VAM failed to load it because of usage of Reflection.
The reason why I want to use Class Library(.NET core) is my external dll seems to have to be compiled with .NET core.
 

Similar threads

Back
Top Bottom