Problem Description:
Some time ago, a VS2010 was installed, with ArcEngine10 in VS2010 based on the. Net Framework 3.5 To create a new Mapcontrol application project, the following creation process:
1. Start Visual Studios 2010.
2 . Select New Project ....
3. Expand arcgis->extending arcobjects and select Mapcontrol application for Visual C # using the. NET framewor K 3.5 and enter Project Name and OK.
4. This starts a new project list items (Properties, References,. cs code, etc.) automatically added to the Soluti On Explorer.
5. at this point, I can builds the project either under DEBUG or release modes and using the x86 Solution Platform . and run the Project w/or w/o debugging and I get the basic, empty Mapcontrol application. Data can be loaded or. MXD files loaded w/o a problem
But as soon as the program runs, a bug similar to the following occurs:
Error 1 failed to load the file or assembly "File:///C:/Program files (x86)/arcgis/developerkit10.0/dotnet/esri. Arcgis.3danalyst.dll "or one of its dependencies. An attempt was made to load an incorrectly formatted program. Line 161, Position 5. Form1.resx 161 5 WindowsFormsApplication2
Or when you originally created a. NET Framework version 3.5 program in VS2008 now upgraded to VS2010 compilation, the following error also occurs.
The same problem occurs when you load these class library files manually.
Compilation Environment:
Operating system: Windows 7 64bit flagship
Compilation Environment: VS 2010 flagship + Arcengine 10
Workaround:
Method One: This problem is caused by the fact that VS2010 is building the. Net Framework 3.5, 3.0 or 2.0 on x64 machine 32-bit programs that cause this problem, detailed workaround see: http://support.microsoft.com/ kb/2028833 (see the article later)
Method Two: Modify the application to the. Net Framework 4.0 environment, the following figure: