Select to view content in your preferred language

Build Solution fails

5645
14
11-17-2009 06:52 AM
JochenManegold
Esri Contributor
I have a installation of ArcGIS Desktop 9.4 and the ArcObjects SDK on a Windows Server 2008 R2 (64 bit). I generated in Visual Studio 2008 a Desktop Class Library from the ESRI Templates and generated a Command based on BaseCommand. If I compile the solution (for the x86 platform), an error occures:
"The command "esriRegasm.exe "C:\Data\jm\JMLib1\JMLib1\bin\x86\Debug\JMLib1.dll" /v 9.4 /p Desktop /s" exited with code -1."
If I run the esriRegasm from the CommandLine - or using the context menu in the explorer - esriRegasm fails with: "Registration failed. Could not write to disk". My account is in the Administrator Group.
0 Kudos
14 Replies
JochenManegold
Esri Contributor
start Visual Studio 2008 with the command "run as administrator" - then it works fine
0 Kudos
JohnFell
Frequent Contributor
I tried running the application as an Administrator but I still get this error as well. Has this happened to anyone else?
0 Kudos
EagerIp
Deactivated User
Check to see if you have the right permission to write to \Program Files\Common Files\ArcGIS\Desktop10.0\Configuration\CATID. Use "Program Files (x86)" if it is a 64-bit OS.
0 Kudos
JohnFell
Frequent Contributor
The permissions are at full control for my login. The properties dialog for this folder states that it is "Read Only (Only applies to files in folder)". See attached screenshot. Still getting error in VS2010.
0 Kudos
JohnFell
Frequent Contributor
Here is the output when I execute esriRegasm.exe from the command line while adding the '/e' flag.

**********************************


ESRIRegAsm::Register
  Command line: "I:\FELLJ\FellJGIS\Projects\Development\dotNETProjects\NewFindTo
ol\NewFindAcctTool\NewFindAcctTool\bin\Debug\NewFindAcctTool.dll" /e /p:Desktop
/s

  Registry Capture On.
  Registering managed library...
  Managed Exception: Could not load file or assembly 'file:///i:\FELLJ\FellJGIS\
Projects\development\dotnetprojects\newfindtool\newfindaccttool\newfindaccttool\
bin\Debug\newfindaccttool.dll' or one of its dependencies. Operation is not supp
orted. (Exception from HRESULT: 0x80131515)
  Registry Capture Off.

Operation Failed
0032C1E8

**********************************

Press Enter to continue...
0 Kudos
EagerIp
Deactivated User
Hi fellj,

I see now that your error is different than the original post.

See if you can try to debug it with the troubleshooting suggestion posted on 2/2/2010 in the following thread http://forums.arcgis.com/threads/1162-Beta-10-Issue-with-ESRIRegAsm?p=4267#post4267.

The goal is to attach esriRegasm.exe to step into your code and see if it throws any useful information during debugging.
0 Kudos
JohnFell
Frequent Contributor
I've made the suggested change to the esriRegasm.exe.config file but nothing has changed. I still get the following error when I try to Clean, Build, or Debug the solution.

The command "esriRegasm.exe "NewFindAcctTool.dll" /p:Desktop /s" exited with code -1.


See attached esriRegasm.exe.config file snapshot.
0 Kudos
RichardWatson
Deactivated User
It looks like your assembly/DLL is failing to load.

You can debug this using the Microsoft Fusion Log Viewer utility, i.e. fuslogvw.  Run the utility from the Visual Studio Command Prompt.  Make sure to set a Custom Log Location and set it to a directory which exists.  What you want to see is binds that fail.  The way that assemblies are located in .NET is complex:(

If this is too much, then try to use the free Reflector utility from Red-Gate.  What you want to do is to expand the dependencies in order to find those that have load issues.  In the unmanaged world this was done using the Depends utility.
0 Kudos
JohnFell
Frequent Contributor
I've followed the suggestion to use the "fuslogvw" utility using the Microsoft Visual Studios 2010 command prompt. As I made an attempt to build the solution the following information was written to the log:

*** Assembly Binder Log Entry  (9/28/2010 @ 11:22:46 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Common Files\ArcGIS\bin\ESRIRegAsm.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = DCAD\FellJ
LOG: DisplayName = msvcm90, Version=9.0.30729.4974, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Common Files/ArcGIS/bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ESRIRegAsm.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Common Files\ArcGIS\bin\ESRIRegAsm.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: msvcm90, Version=9.0.30729.4974, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/ArcGIS/bin/msvcm90.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/ArcGIS/bin/msvcm90/msvcm90.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/ArcGIS/bin/msvcm90.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/ArcGIS/bin/msvcm90/msvcm90.EXE.
LOG: All probing URLs attempted and failed.


With my limited experience in developing .NET applications I cannot interpret these results. What does this tell us?

Thanks for your help.
0 Kudos