Could not load file or assembly 'AssemblyPath' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Method 1Change the value of the Platform target property to x86 or to Any CPU. To do this, follow these steps:
- In Solution Explorer, click the project name.
- On the Project menu, click ProjectName Properties.
- Click the Build tab, and then select one of the following items in the Platform target list:
- Any CPU
- Click the Security tab, and then click Calculate Permissions.
Method 2Use the PermCalc.exe file to manually create the permissions for your assembly. To do this, follow these steps:
- Click Start, click Run, type cmd, and then click OK.
- Type the following command, and then press ENTER:cd DriveLetter:\ Program Files\Microsoft SDKs\Windows\v6.0A\bin\
- Type the following command, and then press ENTER:PermCalc –CleanCache "AssemblyPath"
- Locate and then open the XML file that the PermCalc.exe file created.
- Copy and then paste the contents of the XML file into the App.manifest file in your project.
Article ID: 945357 - Last Review: Dec 13, 2007 - Revision: 1