I' ve solved this issue by adding /tlb: attribute and the type library name of the object as value to the code. Below method is working:
private static void ExecuteRegAsm(string comObjectPath, string typeLibraryName, string regAsmPathToExecute, string regAsmParameter = null)
{
var startInfo = new ProcessStartInfo
{
CreateNoWindow = false,
UseShellExecute = false,
FileName = regAsmPathToExecute,
WindowStyle = ProcessWindowStyle.Hidden
};
switch (regAsmParameter)
{
case null:
startInfo.Arguments = comObjectPath + " /tlb:" + typeLibraryName + " /Codebase";
break;
case "/u":
case "-u":
startInfo.Arguments = comObjectPath + " /tlb:" + typeLibraryName + " /u";
break;
}
using (var exeProcess = Process.Start(startInfo))
{
if (exeProcess != null)
{
exeProcess.WaitForExit();
}
}
}