Is there any way to catch the exception in custom action while installing?
I am creating a setup file using visual studio 2010.I have added two custom actions to pass parameters during the installation.I builds successfully.But gives an error during 开发者_如何学Pythonthe installation
following is the error.
I want to track the place where this exception get fired.And what is the .dll file which having the bad format.
I'm developing the setup file for 64bit target machine.
thanks
There are three immediate reasons you will get BadImageFormatException thrown. The first is that you are trying to load an assembly that is built for a different version of the runtime that is not supported. For example, StickyNote.dll was built for .NET 3.5, but your project is targeted for .NET 2.0. You will get a BadImageFormatException because the 2.0 runtime cannot load an assembly target for the 3.5 runtime. The second is you are trying to load an unmanaged assembly (such as an unmanaged C++ assembly or Windows DLL). The third is there is something seriously wrong with the assembly that hendered the runtime's ability to load the assembly.
There are more possible reasons, but read the MSDN it states them all. Generally BadImageFormatException is something simple going on to fix.
精彩评论