Exception has been thrown by the target of an invocation

Hello!

In a test (non-production) Epicor environment, I have been trying to add a column to one of two grids in a dashboard. The steps I took were as follows:

Using BAQ Designer:

  1. Copy the original BAQ to one with new name
  2. Add a join to a particular table in the top level query, save changes
    Using the Dashboard editor:
  3. Tie the dashboard back to the new, modified BAQ rather than the original
  4. Add the desired column to the appropriate grid (using Properties, and the Visible checkbox)
  5. Deploy Dashboard

Now:
When I open the dashboard view I modified, I throw 2 errors (1, 2).
The grid column I hoped to add is displayed.

When I close the dashboard, I throw a third error (3).

I’ve been using Epicor for only a couple of months, so I’m not familiar with many of the terms in these errors.

I’m posting today for some insight as to the error messages.
Has anyone ever seen these errors (or errors like them) before?
Does anyone have any guidance as to what they might mean, or what remedies they may call for?

Thank you!


(1)
Application Error

Exception caught in: mscorlib

Error Detail

Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: [A]Ice.UI.App.PartLocator.MainController cannot be cast to [B]Ice.UI.App.PartLocator.MainController.

Type A originates from ‘Ice.UI.App.PartLocator_2, Version=3.2.7839.482, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadFrom’
at location ‘C:\ProgramData\Epicor\slmvmepicortest-808\3.2.400.0\USBAND\shared\CustomDLLs\Ice.UI.App.PartLocator_2.dll’.

Type B originates from ‘Ice.UI.App.PartLocator_3, Version=3.2.7838.940, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadFrom’
at location ‘C:\ProgramData\Epicor\slmvmepicortest-808\3.2.400.0\USBAND\shared\CustomDLLs\Ice.UI.App.PartLocator_3.dll’.

Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod

Client Stack Trace

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeInitializeGlobalVariables(CustomScriptManager customScriptManager)
at Ice.Lib.Customization.CustomScriptManager.b__117_0()
at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxIfException(Action action, String exceptionBoxTitle)

Inner Exception

[A]Ice.UI.App.PartLocator.MainController cannot be cast to [B]Ice.UI.App.PartLocator.MainController. Type A originates from ‘Ice.UI.App.PartLocator_2, Version=3.2.7839.482, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadFrom’ at location ‘C:\ProgramData\Epicor\slmvmepicortest-808\3.2.400.0\USBAND\shared\CustomDLLs\Ice.UI.App.PartLocator_2.dll’. Type B originates from ‘Ice.UI.App.PartLocator_3, Version=3.2.7838.940, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadFrom’ at location ‘C:\ProgramData\Epicor\slmvmepicortest-808\3.2.400.0\USBAND\shared\CustomDLLs\Ice.UI.App.PartLocator_3.dll’.

at Script.InitializeGlobalVariables(CustomScriptManager csm)

(2)
Application Error

Exception caught in: mscorlib

Error Detail

Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: Object reference not set to an instance of an object.
Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod

Client Stack Trace

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeCustomFormLoadIfExists(String methodName, Object sender, EventArgs e)
at Ice.Lib.Customization.CustomScriptManager.<>c__DisplayClass104_0.b__0()
at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxOrLogVerificationErrorIfException(Action action, String exceptionBoxTitle)

Inner Exception

Object reference not set to an instance of an object.

at Script.MainController_Load(Object sender, EventArgs args)

(3)
Application Error

Exception caught in: mscorlib

Error Detail

Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: Could not load file or assembly ‘Ice.UI.App.PartLocator_3, Version=3.2.7838.940, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.
Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod

Client Stack Trace

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeDestroyGlobalVariablesIfExists()
at Ice.Lib.Customization.CustomScriptManager.b__120_0()
at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxIfException(Action action, String exceptionBoxTitle)

Inner Exception

Could not load file or assembly ‘Ice.UI.App.PartLocator_3, Version=3.2.7838.940, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

at Script.DestroyGlobalVariables()

@Riggs Hi Aaron, welcome to the forum.

Did you replace the BAQ within the same Dashboard definition? Speaking from my experience with altering dashboards, I would suggest creating a new dashboard definition altogether in which to include your new BAQ, and see if that works.

Hope this helps…
Matthew Morgan

Thanks for the suggestion.

In the test environment, I created a new Dashboard definition.
I set it up to be a copy of the production-side Dashboard definition, save for switching out a BAQ.
There is a second BAQ, which I tied to this Dashboard definition unchanged.

I copied the Dashboard definition that had been throwing all the errors to a new file, ending in “backup.” (ha)

I deleted the original Dashboard definition, as modified (unsuccessfully) by me.
I copied my rebuilt Dashboard definition to one bearing the same name as the original (“PartLocator”).
After one more look to make sure everything was configured as closely to production as possible
(except for my BAQ change), I hit Deploy Dashboard.

And now…I can’t find the app (it’s called Part Locator Dashboard) in a search from the Home screen.
If I were to guess at a reason: Maybe I deleted the Assembly file (.dll extension), without meaning to.
I think there’s another layer to this that I may not have considered.

If that’s correct: What’s the view in E10 from which I might rebuild the .dll file as well?
If that’s incorrect: What else might have happened?

If I understand you correctly, then you’ll have to into Menu Maintenance and assign your new dashboard definition to the menu item. I would suggest deleting the old menu item and creating a new one from scratch, just as with the definition file.

It’s unclear what you mean here. The .dll file is created when you deploy a dashboard definition for the first time, and it’s updated on subsequent deployments. Prior to that it’s a .dbd (dashboard definition) file type.

Hope this helps…
Matthew Morgan