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.