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:
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Target</SPAN> <SPAN class="attr-name token">Name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>BeforeClean<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Exec</SPAN> <SPAN class="attr-name token">WorkingDirectory</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>$(CommonProgramFiles)\ArcGIS\bin<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">Command</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>esriRegasm.exe "$(TargetPath)" /p:Desktop /u /s<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">Condition</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>Exists(<SPAN class="punctuation token">'</SPAN>$(TargetPath)<SPAN class="punctuation token">'</SPAN>)<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="punctuation token">/></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Target</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Target</SPAN> <SPAN class="attr-name token">Name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>AfterBuild<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Exec</SPAN> <SPAN class="attr-name token">WorkingDirectory</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>$(CommonProgramFiles)\ArcGIS\bin<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">Command</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>esriRegasm.exe "$(TargetPath)" /p:Desktop /s<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="punctuation token">/></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Target</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Is there any log that indicates why registerung/unregistering fails?
I´m using VS2017 and ArcGIS Desktop 10.6.1.