AnsweredAssumed Answered

ESRIRegAsm returns -1

Question asked by HimBromBeere on Jun 13, 2019

I have a VS-project that contains some code for some ArcMap-Extensions (no AddIn). Thus when compiling I also register them using ESRIRegAsm as follows:


<Target Name="BeforeClean">
    <Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop /u /s" Condition="Exists('$(TargetPath)')" />
<Target Name="AfterBuild">
    <Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop /s" />


However I always get the following error on ReBuild, which invokes BeforeClean:

error MSB3073: The command "esriRegasm.exe "MyAssembly.dll" /p:Desktop /u /s" terminated with the code -1.


I looked for the appropriate ECFG-file within "C:\Program Files (x86)\Common Files\ArcGIS\Desktop10.6\Configuration\CATID" and there is none for the mentioned project. Therefor I assumed that esriregasm with the /u-switch enabled just returns -1 when there is no such ECGF-file. However when I run the command within a shell with the /u-switch it works just fine, nothing is returned at all, even when there is no ECFG-file:


C:\Program Files (x86)\Common Files\ArcGIS\bin>esriRegasm.exe "C:\MyPath\MyAssembly.dll" /p:Desktop /u /s


Is there any log that indicates why registerung/unregistering fails?


I´m using VS2017 and ArcGIS Desktop 10.6.1.