Debugging dll plugin. 'Start external program' = Exception has been thrown by the target of an invocation

Build, then copy all dlls, exes, pdbs, etc to the plugin’s directory

  • VS is running as admin
  • Start external program = [C:\Program](file:C:/Program) Files\Milestone\XProtect Management Client\VideoOS.Administration.exe
  • Working directory = [c:\Program](file:c:/Program) Files\VideoOS\MIPPlugins\StorageQuest RookArchive\
  • if I run Management client normally, our plugin loads normally

===================================

Exception has been thrown by the target of an invocation. (mscorlib)

------------------------------

Program location:

at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)

at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)

at VideoOS.Platform.Util.PluginManager.FindPlugins(String fileName, Type typeToLoad)

===================================

The type initializer for ‘RookArchive.RookArchiveDefinition’ threw an exception. (RookArchive)

------------------------------

Program location:

at RookArchive.RookArchiveDefinition..ctor()

===================================

Cannot run this plug-in if Debugger is present. (RookArchive)

------------------------------

Program location:

at RookArchive.RookArchiveDefinition..cctor() in [D:\Rimage\RookSource\RookArchive\RookArchiveDefinition.cs](file:D:/Rimage/RookSource/RookArchive/RookArchiveDefinition.cs):line 96

So uploading or pasting screenshots does not seem to work with this forum. Here are some screenshots:

https://i.imgur.com/jGfoO6F.png

https://i.imgur.com/3Hz74Ji.png

2018 R2 Corp

Please see this KB, it might be helpful -

https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins

Thanks for the reply. But is pretty obvious that we are past the step of initially setting up debugging. Also as you can see, this is for the Management client not the smart client.

I have re-read and re-implemented the steps outlined at the link below but there was no change. https://developer.milestonesys.com/s/question/0D53X000088KhH3SAK/debugging-dll-plugin-start-external-program-exception-has-been-thrown-by-the-target-of-an-invocation

For other people reading this; the debug document should be - https://developer.milestonesys.com/s/article/debugging-techniques-for-Management-Client-plugins

I believe it may not contain anything that you are not aware of already.

It seems the stack trace and exception error point to code you have implemented and we have no knowledge of. We are a bit in the dark but an initial guess is that it could be something related to dependencies for your plugin. Do you have the dependencies in the right place? Do you maybe have dependencies where there is a difference in whether they are debug mode or not?

I really hope this leads somewhere..