Load assembly file on button event in dialog #1673
-
Hello, My requirement is to load assembly and call function when user clicks on Next button on dialog box. I have added DefaultRefAssemblies in project declaration and trying to refer this assembly to create instance as System.Reflection.Assembly.LoadFile("filename.dll") But it is giving error for access denied. "at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String str, Boolean needFullPath) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
It means that the location of the assembly is wrong (and the message just incorrectly reports the error). Or indeed the permissions are not set as you expected. As you can see it's not WixSharp but CLR who throws the exception.
I suggest you do a simple experiment. Add the assembly as a
new File(...)
so your installer will deploy it to the target dir. Then in your click handler load the assembly from the known location and do your invoke.I have also attached the sample project that shows you the technique:
WixSharp Setup2.zip