Currently I am calling ADMT COM object in C# with the following code.
Type admtMigration = Type.GetTypeFromProgID("ADMT.Migration",true);
dynamic admt = Activator.CreateInstance(admtMigration);
IList<MethodInfo> props = new List<MethodInfo>(admtMigration.GetMethods());
However It also requires elevated privileges. Running VS 2017 in administrator mode I can debug the application, but after deploying the DLL, the Code throws error.
I have seen this question, and I can't user Application Manifest File for permission,
also I can't decorate my class with
[PrincipalPermission(SecurityAction.Demand, Role = @"BUILTIN\Administrators")]
since it is throwing error at application runtime.
Any Idea how can I run COM object with elevated privileges in C#.