New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# WiX Custom Actions crash with "Could not load file or assembly" #1447
Comments
The correct way of embedding CA dependencies is to add them with Is there any chance that you are embedding an x64 version of assembly (check it in the assembly file). Because if you are then it cannot load to MSI runtime that is always a x86 CPU. If it does not help then I can only suggest the debugging. Isolate your working code in a separate method and call it from the CA body. Before the call subscribe for the AppDomain.CirrentDomain.ResolveAssembly event. Then fire the assertion on the entry in CA (see wiki for debugging steps). This will tell you what are the other dependencies that are missing. |
What worked: Thank you! I am unsure why my original code was not working: |
Yep, the |
I have a C# WiX project, like this (trimmed code):
C# WiX project Main:
The custom action:
When the custom action is executed, it errors out in
Could not load file or assembly Microsoft.Win32.TaskScheduler version....
. I am not sure how to fix this. There's a lot of guides available online, but seems like there's nothing on a WiX C# project, even on WiX's actual documentation. Seems like I need to add a dll file referenced by the action, but the C# project doesn't seem to have similar functionality.actionAssembly
to the required binary with no luck (couldn't find it, seems like no CA file was being created)project.DefaultRefAssemblies.Add(typeof(TaskScheduler).Assembly.Location);
typeof(CustomActions).Assembly.Location
The text was updated successfully, but these errors were encountered: