esriregasm.exe not always installed

6700
10
07-30-2010 07:04 AM
BruceCheney
New Contributor
Forgive me if this is obvious to many of you but I could not find it definitively anywhere.  It appears that ESRIregasm.exe is not always installed with ArcGIS - maybe I am missing something.  Does this mean we need to redistribute this file in order to get our custom .net programs to register properly with ArcGIS 10?
0 Kudos
10 Replies
BruceCheney
New Contributor
Surely someone has the answer to this?  With so many developers updating to ArcGIS 10 already?
0 Kudos
EagerIp
New Contributor II
EsriRegasm.exe should be installed in the common program files folder; e.g.
C:\Program Files\Common Files\ArcGIS\bin on a 32-bit OS. If it is 64-bit, look under "Program Files (x86)\Common Files\ArcGIS\bin".
0 Kudos
BruceCheney
New Contributor
Thank you.  I am aware of the location to find the file.  There-in lies the problem - the files are not installed anywhere. I re-installed at least seven times on a Windows 7 machine to see if I could track down the cause of the missing ESRIregAsm.exe and associated files.  No luck.

Here is a summary of my installs:
1 of the times I selected "Run As Administrator" from the setup.exe under the desktop folder and it worked. ESRIRegASm.exe file and associated files were installed in the Common Files path. (I wanted to prove that this would work each time so I uninstalled again). Unfortunately it did not work any other time I tried the same scenario.
2 of the times I selected "Run As Administrator" from the setup.exe under the desktop folder it did not work
1 of the times I ran directly from the MSI and it did not work
2 of the times I tried to install from the splash screen and it did not work.
1 of the times I selected "Run As Administrator" on the main setup.exe and it did not work.

I do not know what circumstances made the difference for the 1 time it worked.  I have not had this problem on other machines yet.  I am going to try a couple other things to see if I can't talk it into working.
0 Kudos
EagerIp
New Contributor II
Do you see other Esri files in the common file location folder I mentioned? There should be a number of files shared among ArcGIS 10 products.

The only thing I can think of to try is to manually clean up the registry keys related to ArcGIS product installs after uninstalling. Anyways, it sounds like an install/setup issue.
0 Kudos
RichardWatson
Frequent Contributor
ESRI, did you know that your .NET development samples do not work on 64 bit machines?

They do not work because the project file (e.g. csproj) references ESRIRegAsm in the wrong location.
0 Kudos
EagerIp
New Contributor II
ESRI, did you know that your .NET development samples do not work on 64 bit machines?

They do not work because the project file (e.g. csproj) references ESRIRegAsm in the wrong location.


Can you let us know which samples are not working? I just did a random sampling on the ToolAndControlControl sample project came with the ArcObjects .NET SDK; it compiles fine in Visual Studio 2008 on a Win7 64-bit machine.

The sample projects' registration step calling esriRegasm.exe should be using the $(CommonProgramFiles) MSBuild environment variable running inside Visual Studio, which should point to the x86 folder since Visual Studio is a 32-bit application.

Thanks.
0 Kudos
RichardWatson
Frequent Contributor
When I run the "set" command from a DOS window to show the environment variables on a 64 bit machine, this is a subset of what I see:

CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files

The problem is that ESRIRegAsm is not in CommonProgramFiles but rather CommonProgramFiles(x86).

In case it matters, the version of Visual Studio that I am using is 2010.  Perhaps that is the issue because 2010 uses MSBUILD?  Does 2010 on a 64 bit OS work for you?  What does it say when you run set" from the command line?
0 Kudos
EagerIp
New Contributor II
When I run the "set" command from a DOS window to show the environment variables on a 64 bit machine, this is a subset of what I see:

CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files

The problem is that ESRIRegAsm is not in CommonProgramFiles but rather CommonProgramFiles(x86).

In case it matters, the version of Visual Studio that I am using is 2010.  Perhaps that is the issue because 2010 uses MSBUILD?  Does 2010 on a 64 bit OS work for you?  What does it say when you run set" from the command line?


You are correct that esriRegasm.exe lives in the x86 folder but the environment variable set in a regular command prompt is different than MSBuild running inside Visual Studio.

Both Visual Studio 2008 and 2010 uses MSBuild to compile C#/VB.NET projects (VC++ projects switch over to MSBuild at 2010). All versions of Visual Studio are 32-bit applications and the $(CommonProgramFiles) environment variable with MSBuild running inside by default points to the x86 folder. You can verify this by putting these lines in the post/pre-build event

echo $(CommonProgramFiles)
echo $(ProgramFiles)

And observe the results in the Output window

  C:\Program Files (x86)\Common Files
  C:\Program Files (x86)

As long as the samples are compiled in Visual Studio, it should know where to find esriRegasm.exe. If you are running a batch script outside the Visual Studio/MSBuild environment, then you have to be careful to look for the x86 folder.

Hope this helps.
0 Kudos
RichardWatson
Frequent Contributor
Thank you for your response.  It does help.

Obviously, I was wrong.  The problem was occurring for a coworker.  When he moved to a 64 bit machine, ESRIRegAsm was failing.  I looked at the environment variables and incorrectly jumped to the conclusion that this was the heart of the issue.

For some reason, it started working after we created the symbolic link.  In hindsight, the link was not necessary and the illusive problem was elsewhere.
0 Kudos