12 Replies Latest reply on Sep 30, 2013 6:45 AM by agray1

    VS 2010 ArcObject 10 MapControl App Compile Problem

    markparr
      I am experiencing a problem on my Windows 7 Ultimate 64 bit laptop using Visual Studios 2010 to develop an ArcObjects 10 MapControl Application.  Any idea as to the problem would be greatly appreciated.  Here are the steps one at a time leading up to the problem:

      1.  Start Visual Studios 2010.
      2.  Select New Project???.
      3.  Expand ArcGIS->Extending ArcObjects and select MapControl Application for Visual C# using the .NET Framework 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 Solution Explorer.
      5.  At this point, I can Build 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

      Here is where the problem starts:

      6.  Now, double click on the MAINFORM.CS pulling up the Main Form which contains an ArcGIS 10 Engine ToolbarControl, TOCControl, MapControl, and LicenseControl.
      7.  At this point, try to BUILD the application and the following error takes place during the build: 

      Error 1 :
      Could not load file or assembly 'file:///C:/Program Files (x86)/ArcGIS/DeveloperKit10.0/DotNet/ESRI.ArcGIS.ADF.Local.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.   Line 189, position 5.

      Double clicking on the error pulls up the following code in MainForm.resx:

      </value>
        </data>
        <data name="axToolbarControl1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
          <value>
              AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
              LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
              ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAKgMAAAIB
              AAAAAQAAAAAAAAAAAAAAABUDAAAPAAAAAgAAAAEAAAAKAAAAAAAAAACsXgAAUQIAAAAAAAAcAAAAYQB4
      (lot more lines deleted)

      And places the cursor after the SLASH in the </data> XML parameter.

      Any idea what is going on here?