The esriregasm-tool is used to register your own commands, tools or extension for using in ArcGIS. It is usually defined as msbuild-task at the end of your csproj-file as follows:
<Target Name="BeforeClean" Condition=" '$(NO_ESRI_REGASM)' == '' ">
<Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe "$(TargetPath)" /p:Desktop /u /s" Condition="Exists('$(TargetPath)')" />
</Target>
<Target Name="AfterBuild" Condition=" '$(NO_ESRI_REGASM)' == '' ">
<Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe "$(TargetPath)" /p:Desktop /s" />
</Target>
As I get this eror on nearly every rebuild of my solution, I developed a couple of strategies to handle it.
First you can just build the project again. As this won´t invoke the forementioned targets - only on "Clean" or "Rebuild", but not on "Build" - the registration is not executed. However your assembly is created. You can still register it after being compiled, either by rightclicking on the dll-file and selecting Register, or by calling the following within the commandline:
%CommonProgramFiles%\ArcGIS\bin\esriregasm /p:Desktop /u
%CommonProgramFiles%\ArcGIS\bin\esriregasm /p:Desktop
Be aware that I omitted the /s
-flag in order to get more meaningul errors. You can also append the /e
-switch for more verbose errors - which is not really much from my experience.
Now look into folder where the ECFG-files are located. This is usually %CommnonProgramFiles%\ArcGIS\Desktop<version>\Configuration\CATID
. Make sure there is a file with the name of your assembly and the extension ecgf
(it may also have some GUID at the beginning, e.g. {6d102248-13e2-40a0-8011-378543f63901}_MyAssembly.ecfg
). This is just some zip-archieve, you can also unzip it and find an xml-file containing the GUIDs of your commands and tools. If registering the assembly didn´t work with the step mentioned before, you can just delete that ecfg-file and re-build (!!) your assembly. Then verify the file was created in that folder.
If that still does not work, just delete your compiled assembly alltogether with an eventually existing ecfg-file and re-build again.