You control both assemblies and can change them both to use Any CPU. If you’re not using a third-party assembly Which platform target should I use? Any CPU, x86, or 圆4? Any assemblies it references that are using Any CPU will also be loaded as 64-bit assemblies. For example, if you have a console app using Any CPU, and you’re launching it on a 64-bit computer, the console app will be loaded as 64-bit executable. When you use Any CPU, by default executables will use the same bitness as the computer, and assemblies will use the same bitness as the process they are being loaded into. Change Platform target to the appropriate value (Any CPU, x86, or 圆4).Change Configuration to All Configurations.Right-click on your project > click Properties.How to specify the bitness of an assembly To fix this problem, you need to change the bitness of one of the assemblies. System.IO.FileLoadException: ‘Could not load file or assembly. If you’re trying to dynamically load the assembly, for example using Assembly.LoadFrom(), then you’ll get the following exception: An attempt was made to load a program with an incorrect format.’ System.BadImageFormatException: ‘Could not load file or assembly. If your project references another assembly, and the bitness doesn’t match, you’ll get this exception: When you have one assembly trying to use another assembly, and they don’t have matching bitness (圆4 or x86), then you’ll get an exception: either BadImageFormatException or FileLoadException.
0 Comments
Leave a Reply. |