Dynamically loading XSharp assemblies
Posted: Thu Jan 26, 2017 3:22 pm
When trying to load XSharp assemblies with the command VulcanLoadLibrary I received error messages. When substituting this by the function below it works, at least for assemblies without the automatically called init procedures.
But I have seen that it is better to call all initialization manually in the program.
I have seen that runtime errors in the init procedures are very hard to identify, whereas when calling them in the program the runtime errors are displayed with reasonable messages on the screen.
function xsLoadLibrary(libPath as string) as System.Reflection.Assembly
local pdll as System.Reflection.Assembly
pdll := System.Reflection.Assembly.LoadFrom(libPath)
return pdll
But I have seen that it is better to call all initialization manually in the program.
I have seen that runtime errors in the init procedures are very hard to identify, whereas when calling them in the program the runtime errors are displayed with reasonable messages on the screen.
function xsLoadLibrary(libPath as string) as System.Reflection.Assembly
local pdll as System.Reflection.Assembly
pdll := System.Reflection.Assembly.LoadFrom(libPath)
return pdll