hans27 Posted January 24, 2012 Report Share Posted January 24, 2012 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 Quote Link to comment Share on other sites More sharing options...
mostafa Posted January 24, 2012 Report Share Posted January 24, 2012 Check this link Could not load file or assembly or one of its dependencies. Access is denied. « Hosk's Dynamic CRM 2011 Blog and this c# - Could not load file or assembly or one of its dependencies - Stack Overflow Quote Link to comment Share on other sites More sharing options...
hans27 Posted January 25, 2012 Author Report Share Posted January 25, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.