+ Reply to Thread
Results 1 to 13 of 13

Thread: VS 2010 ArcObject 10 MapControl App Compile Problem

  1. #1
    Mark Parr
    Join Date
    Apr 2010
    Posts
    47
    Points
    0
    Answers Provided
    0


    0

    Default VS 2010 ArcObject 10 MapControl App Compile Problem

    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?

  2. #2
    Mark Parr
    Join Date
    Apr 2010
    Posts
    47
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    I did one thing did today where I ran Visual Studio as Administrator but that did not make a difference on the compile of the program. I continued to get the same error.

    Also, once this error is received, the project will not compile from that point forward.

  3. #3
    Mark Parr
    Join Date
    Apr 2010
    Posts
    47
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    More info:

    I tried a GlobeControl application. Same type of thing in that I was able to compile the program and run the application. However, once I opened the MainForm.cs and then tried to compile it failed. This time it died w/ the following error:

    Error 1

    Could not load 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 a program with an incorrect format. Line 129, position 5.

    c:\users\mark\documents\visual studio 2010\Projects\GlobeControlApplication1\GlobeControlApplication1\MainForm.resx

  4. #4
    Christian Degrassi
    Join Date
    Aug 2010
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    Hi,

    have you solved the problem, I have the same issue.
    Fresh ArcEngine installation on VS2010, with Windows 7 Pro x64

    Cheers

  5. #5
    Mark Parr
    Join Date
    Apr 2010
    Posts
    47
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    Contacted ESRI Support and their notes indicated that it was actually a problem w/ MicroSoft and Visual Studios. Support person directed me to this following MicroSoft KB Article:

    http://support.microsoft.com/kb/2028833

  6. #6

    Join Date
    Feb 2011
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    Thanks for the info, this worked prefectly!

  7. #7
    Ron Vincent
    Join Date
    Apr 2010
    Posts
    41
    Points
    1
    Answers Provided
    0


    1

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    I've come across this issue also. To remove this error, double-click on the error in the Error List and it will direct you to the *.resx file. Then, I just simply remove the offending lines:

    <data name="axSymbologyControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
    <value>
    AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
    LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
    ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAswAAAAIB
    AAAAAQAAAAAAAAAAAAAAAJ4AAAADAAAAAgAAAAAAAAAAAAAAAGsfAABjGwAAAQAAAP///wAAAAAAAAAA
    AAAADQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs=
    </value>
    </data>

    Notice that is has base64 at the end of the data name element. You can also just change it from base64 to base32 and that fixes the error. I've only seen this happen with Esri controls.

    Ron

  8. #8
    Kevin Gooss
    Join Date
    May 2010
    Posts
    179
    Points
    15
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    Using the suggested microsoft fix did not work for me and now i can no longer build anything with studio. is there a way to reverse this? why is this still and issue over a year later?

  9. #9
    Kevin Gooss
    Join Date
    May 2010
    Posts
    179
    Points
    15
    Answers Provided
    0


    0

    Unhappy Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    on a different machine i tried to just edit the base64 entries and make them base32.
    this got it to compile but when it ran it is not the same. all of the items in my map app are juxtaposed now.

  10. #10
    Vinh Lam
    Join Date
    Oct 2011
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    I encountered the same error while compiling (Could not load file or assembly 'file:///C:/Program Files (x86)/ArcGIS/DeveloperKit10.0/DotNet/ESRI.ArcGIS.ADF.Local.dll'.....)

    Double clicking the error led me to the .resx file of one of my WinForms.

    <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
    AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAACAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdXh4V0pLS/9dX17xb29v73d6eu+AgYHvent773Bw
    ...
    </value>
    </data>

    To fix my particular problem, I changed the version number of the System.Drawing assembly to be 2.0.0.0.

    A handful of my WinForms had similar problems and I was able to run my application after changing them all.

    The solution suggested at http://support.microsoft.com/kb/2028833 worked for me as well, but it is a global change that affects all Visual Studio projects. So when I compiled another project, I got a bunch of errors.

    Changing the base64 to base32 seemed to have no affect on my error.

  11. #11
    Keith Olson
    Join Date
    Jun 2010
    Posts
    28
    Points
    2
    Answers Provided
    1


    0

    Exclamation Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    HELP!!!

    I had the same problem and followed the steps at http://support.microsoft.com/kb/2028833, but now Visual Studio won't compile anything! I get the error "Resgen.exe exited with code –1073741813" How do you reverse those steps? There was a message saying that I'll need to resign the assembly. What's that about?
    Keith Olson, GISP
    Colorado State University

  12. #12
    George Clooney
    Join Date
    May 2010
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    How can the controls be THIS GOOD!? WOW!

  13. #13
    Alexander Gray
    Join Date
    Apr 2010
    Posts
    685
    Points
    201
    Answers Provided
    32


    0

    Default Re: VS 2010 ArcObject 10 MapControl App Compile Problem

    64 bit with desktop 10.0 uh? We are all waiting for that one. Of course MS could do better to support those stuck in a 32 universe...

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts