public SolcLibAdvDLProvider() { var config = ImplementationOptions.UseLazyBinding; var resolver = new LibFilePathResolver(); try { var builder = new NativeLibraryBuilder(config, resolver); _native = builder.ActivateInterface <IAdvDLSolcLib>(LIB_FILE); } catch (FileNotFoundException) { var result = resolver.Resolve(LIB_FILE); throw result.Exception ?? new Exception(result.ErrorReason); } }
public static INativeSolcLib Create() { var config = ImplementationOptions.UseLazyBinding; var resolver = new LibFilePathResolver(); try { var builder = new NativeLibraryBuilder(config, resolver); var library = builder.ActivateClass <AdvDLSolcLibBase, IAdvDLSolcLib>(LIB_FILE); return(library); } catch (FileNotFoundException) { var result = resolver.Resolve(LIB_FILE); throw result.Exception ?? new Exception(result.ErrorReason); } }