ESRIRegAsm returns -1

628
0
06-13-2019 03:47 AM
CarstenSchumann
Occasional Contributor

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>
<Target Name="AfterBuild">
    <Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop /s" />
</Target>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

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.

0 Kudos
0 Replies