Jump to content

Problems using ArcGIS Engine 10 in VB.Net


hans27

Recommended Posts

Hello,

          I have given a project from my lecturer to develop a basic gis system application. I plan to use vb.net with arcgis engine to develop the system. So my problems is when i try to use map control, toolbar control and TOC control to start debugging, i get an error message "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.". Someone help pls..

Im using windows 7 64bit

ArcGIS engine 10

ArcGIS desktop 10

Visual Studio 10

capturezdr.jpg

Link to comment
Share on other sites

Thank you very much for the link. It very useful and gives me a clue about stack overflow :cheesy:..The problem is due to building an application targeted for x86 configuration on x64 machine with Visual Studio 2010. The project contains a resource file referencing a 32-bit assembly. Target Framework selected is 3.5 for ArcGIS engine 10. That why i get the following error:

"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."

Is is because Resgen.exe, which is a part of Windows SDK, is marked as MSIL and hence it will run as a 64-bit process. It will try to load a 32-bit assembly and fail.

So the solution is

1. Close all instances of Visual Studio.

2. From the Visual Studio Tools subfolder, open an elevated “Visual Studio Command Prompt (2010)” (using “Run as administrator” option). Change directory to "<system_drive>:\Program Files (x86)\Microsoft SDKs\Windows\v<x.xx>\bin\”.

3. Issue the command :

corflags /32bit+ ResGen.exe /force

4. Open <project_name>.csproj or  <project_name>.vbproj in notepad.

5. Add the following property <ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture> under the PropertyGroup section. Save and close the csproj/vbproj file.

Problem solved

capture1af.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist